chore: release v1.32.27 #318
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: "Docker Publish" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| build: | |
| name: docker (${{ matrix.arch }}) | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: write | |
| packages: write | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-24.04 | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 # peter-evans/dockerhub-description need checkout README.md | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| moonrailgun/tianji | |
| ghcr.io/msgbyte/tianji | |
| tags: | | |
| type=semver,pattern={{version}} | |
| - name: Login to DockerHub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Log into ghcr.io registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push | |
| id: build | |
| uses: docker/build-push-action@v5 | |
| with: | |
| # context: . | |
| file: ./Dockerfile | |
| platforms: linux/${{ matrix.arch }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| outputs: type=image,"name=moonrailgun/tianji,ghcr.io/msgbyte/tianji",push-by-digest=true,name-canonical=true,push=true | |
| - name: Export digest | |
| run: | | |
| mkdir -p "${{ runner.temp }}/digests" | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "${{ runner.temp }}/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: digests-${{ matrix.arch }} | |
| path: ${{ runner.temp }}/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| merge: | |
| name: docker manifest | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 # peter-evans/dockerhub-description need checkout README.md | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| moonrailgun/tianji | |
| ghcr.io/msgbyte/tianji | |
| tags: | | |
| type=semver,pattern={{version}} | |
| - name: Login to DockerHub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Log into ghcr.io registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Download digests | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: digests-* | |
| path: ${{ runner.temp }}/digests | |
| merge-multiple: true | |
| - name: Create multi-platform manifests | |
| env: | |
| DOCKER_TAGS: ${{ steps.meta.outputs.tags }} | |
| run: | | |
| shopt -s nullglob | |
| digest_files=("${{ runner.temp }}/digests"/*) | |
| if (( ${#digest_files[@]} != 2 )); then | |
| echo "Expected 2 platform digests, found ${#digest_files[@]}" >&2 | |
| exit 1 | |
| fi | |
| while IFS= read -r tag; do | |
| sources=() | |
| for digest_file in "${digest_files[@]}"; do | |
| sources+=("${tag%:*}@sha256:$(basename "$digest_file")") | |
| done | |
| docker buildx imagetools create --tag "$tag" "${sources[@]}" | |
| done <<< "$DOCKER_TAGS" | |
| - name: Update repo description | |
| uses: peter-evans/dockerhub-description@v3 | |
| continue-on-error: true | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: moonrailgun/tianji | |
| readme-filepath: ./README.md |