chore: bump version to 2026.4.20.1, upgrade actions/checkout to v5 #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| ci-backend: | |
| uses: ./.github/workflows/backend.yml | |
| ci-frontend: | |
| uses: ./.github/workflows/frontend.yml | |
| ci-version-check: | |
| uses: ./.github/workflows/version-check.yml | |
| ci-e2e: | |
| uses: ./.github/workflows/e2e.yml | |
| validate: | |
| needs: [ci-backend, ci-frontend, ci-version-check, ci-e2e] | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.check.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Validate tag matches source versions | |
| id: check | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| BACKEND=$(python3 -c " | |
| import tomllib | |
| with open('backend/pyproject.toml', 'rb') as f: | |
| print(tomllib.load(f)['project']['version']) | |
| ") | |
| FRONTEND=$(node -p "require('./frontend/package.json').version") | |
| echo "Tag: $TAG_VERSION" | |
| echo "Backend: $BACKEND" | |
| echo "Frontend: $FRONTEND" | |
| if [ "$TAG_VERSION" != "$BACKEND" ] || [ "$TAG_VERSION" != "$FRONTEND" ]; then | |
| echo "::error::Version mismatch: tag=$TAG_VERSION backend=$BACKEND frontend=$FRONTEND" | |
| exit 1 | |
| fi | |
| echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT" | |
| build-backend: | |
| needs: validate | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: slug | |
| run: echo "arch=${PLATFORM##*/}" >> "$GITHUB_OUTPUT" | |
| env: | |
| PLATFORM: ${{ matrix.platform }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/backend/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ github.repository_owner }}/waffleweather-backend:${{ needs.validate.outputs.version }}-${{ steps.slug.outputs.arch }} | |
| cache-from: type=gha,scope=backend-${{ steps.slug.outputs.arch }} | |
| cache-to: type=gha,mode=max,scope=backend-${{ steps.slug.outputs.arch }} | |
| merge-backend: | |
| needs: [validate, build-backend] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create multi-arch manifest | |
| run: | | |
| IMAGE=${{ env.REGISTRY }}/${{ github.repository_owner }}/waffleweather-backend | |
| VERSION=${{ needs.validate.outputs.version }} | |
| docker buildx imagetools create \ | |
| -t "$IMAGE:$VERSION" \ | |
| -t "$IMAGE:latest" \ | |
| "$IMAGE:$VERSION-amd64" \ | |
| "$IMAGE:$VERSION-arm64" | |
| build-frontend: | |
| needs: validate | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: slug | |
| run: echo "arch=${PLATFORM##*/}" >> "$GITHUB_OUTPUT" | |
| env: | |
| PLATFORM: ${{ matrix.platform }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/frontend/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ github.repository_owner }}/waffleweather-frontend:${{ needs.validate.outputs.version }}-${{ steps.slug.outputs.arch }} | |
| build-args: | | |
| NEXT_PUBLIC_API_URL= | |
| NEXT_PUBLIC_WS_URL= | |
| cache-from: type=gha,scope=frontend-${{ steps.slug.outputs.arch }} | |
| cache-to: type=gha,mode=max,scope=frontend-${{ steps.slug.outputs.arch }} | |
| merge-frontend: | |
| needs: [validate, build-frontend] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create multi-arch manifest | |
| run: | | |
| IMAGE=${{ env.REGISTRY }}/${{ github.repository_owner }}/waffleweather-frontend | |
| VERSION=${{ needs.validate.outputs.version }} | |
| docker buildx imagetools create \ | |
| -t "$IMAGE:$VERSION" \ | |
| -t "$IMAGE:latest" \ | |
| "$IMAGE:$VERSION-amd64" \ | |
| "$IMAGE:$VERSION-arm64" | |
| release: | |
| needs: [validate, merge-backend, merge-frontend] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true |