|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "main" |
| 7 | + tags: |
| 8 | + - "v*" |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + id-token: write |
| 13 | + packages: write |
| 14 | + |
| 15 | +jobs: |
| 16 | + goreleaser: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + env: |
| 19 | + DOCKER_CLI_EXPERIMENTAL: "enabled" |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - uses: arduino/setup-task@v2 |
| 26 | + with: |
| 27 | + version: 3.x |
| 28 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 29 | + |
| 30 | + - uses: docker/setup-qemu-action@v3 |
| 31 | + |
| 32 | + - uses: docker/setup-buildx-action@v3 |
| 33 | + |
| 34 | + - name: setup-snapcraft |
| 35 | + # FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715 |
| 36 | + run: | |
| 37 | + sudo apt-get update |
| 38 | + sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft |
| 39 | + mkdir -p $HOME/.cache/snapcraft/download |
| 40 | + mkdir -p $HOME/.cache/snapcraft/stage-packages |
| 41 | +
|
| 42 | + - uses: actions/setup-go@v5 |
| 43 | + with: |
| 44 | + go-version-file: go.mod |
| 45 | + |
| 46 | + - uses: sigstore/cosign-installer@v3.5.0 |
| 47 | + |
| 48 | + - uses: anchore/sbom-action/download-syft@v0.15.11 |
| 49 | + |
| 50 | + - name: ghcr-login |
| 51 | + uses: docker/login-action@v3 |
| 52 | + with: |
| 53 | + registry: ghcr.io |
| 54 | + username: ${{ github.repository_owner }} |
| 55 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + |
| 57 | + - name: Install GoReleaser |
| 58 | + uses: goreleaser/goreleaser-action@v5 |
| 59 | + with: |
| 60 | + install-only: true |
| 61 | + |
| 62 | + - name: goreleaser-release |
| 63 | + env: |
| 64 | + AUR_KEY: "${{ secrets.AUR_KEY }}" |
| 65 | + FURY_PUSH_TOKEN: "${{ secrets.FURY_PUSH_TOKEN }}" |
| 66 | + GITHUB_TOKEN: ${{ secrets.GH_PAT }} |
| 67 | + # SNAPCRAFT_STORE_CREDENTIALS: "${{ secrets.SNAPCRAFT_LOGIN }}" |
| 68 | + GITHUB_REF: "${{ github.ref }}" |
| 69 | + run: task goreleaser |
0 commit comments