chore: update release workflow to use new format and setup for docker
Some checks failed
Docker Build (PR) / Build Docker image (pull_request) Failing after 5m3s
Some checks failed
Docker Build (PR) / Build Docker image (pull_request) Failing after 5m3s
This commit is contained in:
@@ -2,35 +2,33 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
github_release:
|
github_release:
|
||||||
description: 'Create Gitea Release'
|
description: "Create Gitea Release"
|
||||||
default: true
|
default: true
|
||||||
type: boolean
|
type: boolean
|
||||||
docker_release:
|
docker_release:
|
||||||
description: 'Push Docker images'
|
description: "Push Docker images"
|
||||||
default: true
|
default: true
|
||||||
type: boolean
|
type: boolean
|
||||||
bump:
|
bump:
|
||||||
description: 'Bump type'
|
description: "Bump type"
|
||||||
required: false
|
required: false
|
||||||
default: 'patch'
|
default: "patch"
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- 'major'
|
- "major"
|
||||||
- 'minor'
|
- "minor"
|
||||||
- 'patch'
|
- "patch"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v4.2.2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Fetch full history
|
fetch-depth: 0 # Fetch full history
|
||||||
fetch-tags: true # Fetch all tags (refs/tags)
|
fetch-tags: true # Fetch all tags (refs/tags)
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v5
|
||||||
@@ -44,7 +42,7 @@ jobs:
|
|||||||
uv add pip
|
uv add pip
|
||||||
uv export --format requirements.txt -o requirements.txt
|
uv export --format requirements.txt -o requirements.txt
|
||||||
# uv run python -m pip install --upgrade pip
|
# uv run python -m pip install --upgrade pip
|
||||||
# uv run python -m pip install -r requirements.txt
|
# uv run python -m pip install -r requirements.txt
|
||||||
|
|
||||||
- name: Set Git identity
|
- name: Set Git identity
|
||||||
run: |
|
run: |
|
||||||
@@ -61,6 +59,8 @@ jobs:
|
|||||||
echo "EOF" >> $GITHUB_ENV
|
echo "EOF" >> $GITHUB_ENV
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@@ -78,31 +78,46 @@ jobs:
|
|||||||
echo "tag=$prev" >> "$GITHUB_OUTPUT"
|
echo "tag=$prev" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
|
||||||
- name: Build and store Docker image for multiple architectures
|
- name: Compute lowercased image repo
|
||||||
if: ${{ github.event.inputs.docker_release == 'true' }}
|
if: ${{ github.event.inputs.docker_release == 'true' }}
|
||||||
|
|
||||||
run: |
|
run: |
|
||||||
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
echo "IMAGE_REPO=${{ secrets.REGISTRY }}/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||||
docker buildx build \
|
|
||||||
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
- name: Docker meta
|
||||||
--tag ${{ secrets.REGISTRY }}/${REPO_NAME}:latest \
|
if: ${{ github.event.inputs.docker_release == 'true' }}
|
||||||
--tag ${{ secrets.REGISTRY }}/${REPO_NAME}:${{ env.VERSION }} \
|
id: meta
|
||||||
--push .
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.IMAGE_REPO }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest
|
||||||
|
type=raw,value=${{ env.VERSION }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
if: ${{ github.event.inputs.docker_release == 'true' }}
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
- name: Build Changelog
|
- name: Build Changelog
|
||||||
id: build_changelog
|
id: build_changelog
|
||||||
uses: https://github.com/mikepenz/release-changelog-builder-action@v5
|
uses: https://github.com/mikepenz/release-changelog-builder-action@v5
|
||||||
with:
|
with:
|
||||||
platform: "gitea"
|
platform: "gitea"
|
||||||
baseURL: "http://gitea:3000"
|
baseURL: "http://192.168.178.110:3000"
|
||||||
configuration: ".gitea/changelog_config.json"
|
configuration: ".gitea/changelog_config.json"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
if: ${{ github.event.inputs.github_release == 'true' }}
|
if: ${{ github.event.inputs.github_release == 'true' }}
|
||||||
@@ -115,6 +130,4 @@ jobs:
|
|||||||
prerelease: false
|
prerelease: false
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user