From 84f5c025db26cf6b9c3346a60ea066b8418401c2 Mon Sep 17 00:00:00 2001 From: WorldTeacher Date: Wed, 19 Nov 2025 15:48:09 +0100 Subject: [PATCH] chore: update release workflow to use new format and setup for docker --- .gitea/workflows/release.yml | 67 +++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 4eac1e4..1f9c846 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -2,35 +2,33 @@ on: workflow_dispatch: inputs: github_release: - description: 'Create Gitea Release' + description: "Create Gitea Release" default: true type: boolean docker_release: - description: 'Push Docker images' + description: "Push Docker images" default: true type: boolean bump: - description: 'Bump type' + description: "Bump type" required: false - default: 'patch' + default: "patch" type: choice options: - - 'major' - - 'minor' - - 'patch' + - "major" + - "minor" + - "patch" - - jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@master + uses: actions/checkout@v4.2.2 with: - fetch-depth: 0 # Fetch full history - fetch-tags: true # Fetch all tags (refs/tags) + fetch-depth: 0 # Fetch full history + fetch-tags: true # Fetch all tags (refs/tags) - name: Install uv uses: astral-sh/setup-uv@v5 @@ -44,7 +42,7 @@ jobs: uv add pip uv export --format requirements.txt -o requirements.txt # 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 run: | @@ -61,6 +59,8 @@ jobs: echo "EOF" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -78,31 +78,46 @@ jobs: 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' }} - run: | - REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') - docker buildx build \ - --platform linux/amd64,linux/arm64,linux/arm/v7 \ - --tag ${{ secrets.REGISTRY }}/${REPO_NAME}:latest \ - --tag ${{ secrets.REGISTRY }}/${REPO_NAME}:${{ env.VERSION }} \ - --push . + echo "IMAGE_REPO=${{ secrets.REGISTRY }}/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Docker meta + if: ${{ github.event.inputs.docker_release == 'true' }} + id: meta + 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 uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }} - name: Build Changelog id: build_changelog uses: https://github.com/mikepenz/release-changelog-builder-action@v5 with: platform: "gitea" - baseURL: "http://gitea:3000" + baseURL: "http://192.168.178.110:3000" configuration: ".gitea/changelog_config.json" env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} - name: Create Gitea Release if: ${{ github.event.inputs.github_release == 'true' }} @@ -115,6 +130,4 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.TOKEN }} - GITHUB_REPOSITORY: ${{ github.repository }} - - + GITHUB_REPOSITORY: ${{ github.repository }} \ No newline at end of file