|
| 1 | +name: 'Release the container image' |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag: |
| 7 | + type: string |
| 8 | + required: true |
| 9 | + description: "git tag to checkout and create the release" |
| 10 | + workflow_call: |
| 11 | + inputs: |
| 12 | + tag: |
| 13 | + type: string |
| 14 | + required: true |
| 15 | + description: "git tag to checkout and create the release" |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-and-publish-images: |
| 19 | + timeout-minutes: 100 |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + permissions: |
| 23 | + contents: write |
| 24 | + packages: write |
| 25 | + id-token: write # needed for signing the images with GitHub OIDC Token |
| 26 | + |
| 27 | + name: build-images |
| 28 | + steps: |
| 29 | + - name: Maximize build space |
| 30 | + uses: easimon/maximize-build-space@v10 |
| 31 | + with: |
| 32 | + overprovision-lvm: 'true' |
| 33 | + remove-dotnet: 'true' |
| 34 | + remove-android: 'true' |
| 35 | + remove-haskell: 'true' |
| 36 | + remove-codeql: 'true' |
| 37 | + remove-docker-images: 'true' |
| 38 | + |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + fetch-depth: 1 |
| 42 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + |
| 44 | + - uses: actions/setup-go@v5 |
| 45 | + with: |
| 46 | + go-version: "1.23" |
| 47 | + |
| 48 | + - name: Install Cosign |
| 49 | + |
| 50 | + |
| 51 | + - name: Login to GitHub Container Registry |
| 52 | + uses: docker/login-action@v3 |
| 53 | + with: |
| 54 | + registry: ghcr.io |
| 55 | + username: ${{ github.actor }} |
| 56 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + |
| 58 | + - name: Set up QEMU # required for multi-arch builds by GoReleaser |
| 59 | + uses: docker/setup-qemu-action@v3 |
| 60 | + |
| 61 | + - name: Install arm C compiler toolchain # for boring crypto |
| 62 | + run: sudo apt-get update && sudo apt-get install -y gccgo-aarch64-linux-gnu |
| 63 | + |
| 64 | + - name: Set up Docker Buildx |
| 65 | + uses: docker/setup-buildx-action@v3 |
| 66 | + |
| 67 | + - name: Release with goreleaser |
| 68 | + timeout-minutes: 90 |
| 69 | + uses: goreleaser/goreleaser-action@v4 |
| 70 | + with: |
| 71 | + distribution: goreleaser |
| 72 | + version: '~> v1' |
| 73 | + args: release --clean --timeout 90m |
| 74 | + env: |
| 75 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + IMAGE_TAG: ${{ inputs.tag }} |
0 commit comments