Release #2
Workflow file for this run
This file contains 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*"] | |
jobs: | |
prepare: | |
strategy: | |
matrix: | |
GOOS: [linux, windows, darwin] | |
GOARCH: ["386", amd64, arm64, ppc64le, arm, s390x] | |
exclude: | |
- GOOS: darwin | |
GOARCH: "386" | |
- GOOS: darwin | |
GOARCH: s390x | |
- GOOS: windows | |
GOARCH: arm64 | |
- GOOS: darwin | |
GOARCH: arm | |
- GOOS: windows | |
GOARCH: arm | |
- GOOS: windows | |
GOARCH: s390x | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: sigstore/cosign-installer@v2 | |
- uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64,ppc64le,linux/arm/v7,s390x | |
- uses: docker/setup-buildx-action@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '~1.21.1' | |
check-latest: true | |
- name: Generate distribution sources | |
run: make generate-sources | |
- name: Log into Docker.io | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Package Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- shell: bash | |
run: | | |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- uses: goreleaser/goreleaser-action@v5 | |
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit | |
with: | |
distribution: goreleaser-pro | |
version: latest | |
args: release --clean --split --timeout 2h | |
env: | |
GOOS: ${{ matrix.GOOS }} | |
GOARCH: ${{ matrix.GOARCH }} | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
COSIGN_EXPERIMENTAL: true | |
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: all-artifacts | |
path: dist/*/* | |
release: | |
name: Release | |
runs-on: ubuntu-20.04 | |
needs: prepare | |
permissions: | |
id-token: write | |
packages: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: sigstore/cosign-installer@v2 | |
- uses: anchore/sbom-action/[email protected] | |
- uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64,ppc64le,s390x | |
- uses: docker/setup-buildx-action@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '~1.21.1' | |
check-latest: true | |
- uses: actions/download-artifact@v3 | |
with: | |
name: all-artifacts | |
path: dist | |
- name: Log into Docker.io | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
- name: Login to GitHub Package Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: goreleaser/goreleaser-action@v5 | |
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit | |
with: | |
distribution: goreleaser-pro | |
version: latest | |
args: continue --merge --timeout 2h | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COSIGN_EXPERIMENTAL: true | |
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} |