|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + release-drafter: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + contents: write |
| 13 | + pull-requests: read |
| 14 | + steps: |
| 15 | + - uses: release-drafter/release-drafter@5de93583980a40bd78603b6dfdcda5b4df377b32 # v7.2.0 |
| 16 | + with: |
| 17 | + tag: ${{ github.ref_name }} |
| 18 | + |
| 19 | + goreleaser: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + needs: |
| 22 | + - release-drafter |
| 23 | + permissions: |
| 24 | + # For GoReleaser |
| 25 | + contents: write |
| 26 | + # For actions/attest |
| 27 | + id-token: write |
| 28 | + attestations: write |
| 29 | + artifact-metadata: write |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 32 | + with: |
| 33 | + fetch-depth: 0 |
| 34 | + persist-credentials: false |
| 35 | + - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 36 | + with: |
| 37 | + go-version: stable |
| 38 | + |
| 39 | + - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 |
| 40 | + id: app-token |
| 41 | + with: |
| 42 | + client-id: ${{ vars.TASTENDRUCK_CLIENT_ID }} |
| 43 | + private-key: ${{ secrets.TASTENDRUCK_PRIVATE_KEY }} |
| 44 | + owner: ${{ github.repository_owner }} |
| 45 | + repositories: homebrew-tap |
| 46 | + permission-contents: write |
| 47 | + permission-pull-requests: write |
| 48 | + |
| 49 | + - uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0 |
| 50 | + with: |
| 51 | + version: "~> v2" |
| 52 | + args: release --clean |
| 53 | + env: |
| 54 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + GORELEASER_HOMEBREW_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
| 56 | + |
| 57 | + - uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 |
| 58 | + with: |
| 59 | + subject-checksums: ./dist/checksums.txt |
| 60 | + |
| 61 | + - uses: cloudsmith-io/cloudsmith-cli-action@18665afcce9f859312b61989671af9af7402e4fb # v2.0.2 |
| 62 | + with: |
| 63 | + api-key: ${{ secrets.CLOUDSMITH_API_KEY_TASTENDRUCK }} |
| 64 | + - run: echo "VERSION=${TAG#v}" >> "$GITHUB_ENV" |
| 65 | + env: |
| 66 | + TAG: ${{ github.ref_name }} |
| 67 | + - run: cloudsmith push deb typisttech/oss/any-distro/any-version "dist/wpry_${VERSION}_linux_amd64.deb" |
| 68 | + - run: cloudsmith push deb typisttech/oss/any-distro/any-version "dist/wpry_${VERSION}_linux_arm64.deb" |
| 69 | + - run: cloudsmith push alpine typisttech/oss/alpine/any-version "dist/wpry_${VERSION}_linux_amd64.apk" |
| 70 | + - run: cloudsmith push alpine typisttech/oss/alpine/any-version "dist/wpry_${VERSION}_linux_arm64.apk" |
0 commit comments