|
1 | | -name: Release |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - tags: |
6 | | - - "*" |
7 | | - |
8 | | -jobs: |
9 | | - test: |
10 | | - uses: Open-CMSIS-Pack/generator-bridge/.github/workflows/test.yml@main |
11 | | - |
12 | | - goreleaser: |
13 | | - runs-on: ubuntu-latest |
14 | | - needs: test |
15 | | - permissions: |
16 | | - contents: write # for goreleaser/goreleaser-action to create a GitHub release |
17 | | - steps: |
18 | | - - name: Harden Runner |
19 | | - uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 |
20 | | - with: |
21 | | - egress-policy: audit |
22 | | - |
23 | | - - name: Download test results |
24 | | - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
25 | | - with: |
26 | | - pattern: test-results-* |
27 | | - path: testreport/ |
28 | | - |
29 | | - - name: Zip test reports |
30 | | - run: | |
31 | | - zip -r testreport.zip testreport |
32 | | -
|
33 | | - - name: Attach test report to release assets |
34 | | - if: startsWith(github.ref, 'refs/tags/') |
35 | | - uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2 |
36 | | - with: |
37 | | - repo_token: ${{ secrets.GITHUB_TOKEN }} |
38 | | - file: testreport.zip |
39 | | - tag: ${{ github.ref }} |
40 | | - overwrite: true |
41 | | - |
42 | | - - name: Checkout |
43 | | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
44 | | - |
45 | | - - name: Install Go |
46 | | - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 |
47 | | - with: |
48 | | - go-version-file: go.mod |
49 | | - check-latest: true |
50 | | - |
51 | | - - name: Run GoReleaser |
52 | | - uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0 |
53 | | - with: |
54 | | - distribution: goreleaser |
55 | | - version: "~> v2" |
56 | | - args: release --clean |
57 | | - env: |
58 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + test: |
| 10 | + uses: Open-CMSIS-Pack/generator-bridge/.github/workflows/test.yml@main |
| 11 | + |
| 12 | + goreleaser: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + needs: test |
| 15 | + permissions: |
| 16 | + contents: write # for goreleaser/goreleaser-action to create a GitHub release |
| 17 | + steps: |
| 18 | + - name: Harden Runner |
| 19 | + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 |
| 20 | + with: |
| 21 | + egress-policy: audit |
| 22 | + |
| 23 | + - name: Download test results |
| 24 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 25 | + with: |
| 26 | + pattern: test-results-* |
| 27 | + path: testreport/ |
| 28 | + |
| 29 | + - name: Zip test reports |
| 30 | + run: | |
| 31 | + zip -r testreport.zip testreport |
| 32 | +
|
| 33 | + - name: Attach test report to release assets |
| 34 | + if: startsWith(github.ref, 'refs/tags/') |
| 35 | + uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2 |
| 36 | + with: |
| 37 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + file: testreport.zip |
| 39 | + tag: ${{ github.ref }} |
| 40 | + overwrite: true |
| 41 | + |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 44 | + |
| 45 | + - name: Install Go |
| 46 | + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 |
| 47 | + with: |
| 48 | + go-version-file: go.mod |
| 49 | + check-latest: true |
| 50 | + |
| 51 | + - name: Run GoReleaser |
| 52 | + uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0 |
| 53 | + with: |
| 54 | + distribution: goreleaser |
| 55 | + version: "~> v2" |
| 56 | + args: release --clean |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
0 commit comments