Update dependency org.apache.maven.plugin-tools:maven-plugin-annotati… #22
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 Docker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: ["*"] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| strategy: | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| arch: amd64 | |
| - runner: ubuntu-24.04-arm | |
| arch: arm64 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Resolve Docker tag | |
| id: tag | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| image="ghcr.io/scip-code/scip-java" | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| version="${GITHUB_REF_NAME#v}" | |
| tag="${image}:${version}-${{ matrix.arch }}" | |
| else | |
| tag="${image}:latest-snapshot-${{ matrix.arch }}" | |
| fi | |
| echo "tag=${tag}" >> "$GITHUB_OUTPUT" | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/${{ matrix.arch }} | |
| tags: ${{ steps.tag.outputs.tag }} | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/scip-code/scip-java | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| publish-manifest: | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| image="ghcr.io/scip-code/scip-java" | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| version="${GITHUB_REF_NAME#v}" | |
| docker buildx imagetools create \ | |
| --tag "${image}:latest" \ | |
| --tag "${image}:${version}" \ | |
| "${image}:${version}-amd64" \ | |
| "${image}:${version}-arm64" | |
| else | |
| docker buildx imagetools create \ | |
| --tag "${image}:latest-snapshot" \ | |
| "${image}:latest-snapshot-amd64" \ | |
| "${image}:latest-snapshot-arm64" | |
| fi |