@@ -15,35 +15,47 @@ jobs:
1515 runs-on : ubuntu-latest
1616 outputs :
1717 artifact-id : ${{ steps.upload-artifact.outputs.artifact-id }}
18+ artifact_dir : ${{ steps.build.outputs.artifact_dir }}
1819
1920 steps :
2021 - name : checkout
21- uses : actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # pin@v4
22+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # pin@v5.0.0
2223 with :
2324 fetch-depth : 0
2425 persist-credentials : false
2526
2627 - name : setup go
27- uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # pin@v5
28+ uses : actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # pin@v6
2829 with :
2930 go-version-file : " go.mod"
3031 cache : false
3132
3233 - name : bootstrap
3334 run : script/bootstrap
3435
35- - name : goreleaser
36- uses : goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # pin@v6
36+ - name : setup goreleaser
37+ uses : goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # pin@v6.4.0
3738 with :
38- args : release --clean
39+ install-only : true
40+ version : ' ~> v2'
41+
42+ # IMPORTANT: this step MUST export for the following outputs:
43+ # artifact_dir: the path to the dir where artifacts are stored - ex: "dist"
44+ # Note: this step will build the binaries via goreleaser, place the artifacts in a dir (ex: "dist"), and then export that path as artifact_dir...
45+ # ... finally it will then publish a GitHub Release with those artifacts attached
46+ - name : build and release
47+ id : build
3948 env :
4049 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+ run : script/build --release
4151
4252 - name : upload artifact
43- uses : actions/upload-artifact@v4.6.2
53+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@ v4.6.2
4454 id : upload-artifact
4555 with :
46- path : dist/
56+ name : ${{ steps.build.outputs.artifact_dir }} # name and path can just both be artifact_dir (ex: "dist") to keep it simple
57+ path : ${{ steps.build.outputs.artifact_dir }}
58+ if-no-files-found : error
4759
4860 sign :
4961 needs : release
@@ -53,29 +65,36 @@ jobs:
5365 attestations : write
5466 contents : read
5567 steps :
56- - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
68+ - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0
5769 with :
5870 artifact-ids : ${{ needs.release.outputs.artifact-id }}
71+ path : ${{ needs.release.outputs.artifact_dir }}
72+
73+ - name : view artifact
74+ env :
75+ ARTIFACT_PATH : ${{ needs.release.outputs.artifact_dir }}
76+ run : tree -L 2 -a --dirsfirst -C -F -h -D "${ARTIFACT_PATH}"
5977
6078 - name : attest build provenance
61- uses : actions/attest-build-provenance@v3.0.0
79+ uses : actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # pin@ v3.0.0
6280 with :
63- subject-path : " . "
81+ subject-path : " ${{ needs.release.outputs.artifact_dir }}/ "
6482
6583 verify :
6684 permissions : {}
6785 runs-on : ubuntu-latest
6886 needs : [release, sign]
6987 steps :
70- - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
88+ - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0
7189 with :
7290 artifact-ids : ${{ needs.release.outputs.artifact-id }}
91+ path : ${{ needs.release.outputs.artifact_dir }}
7392
7493 - name : verify
7594 env :
7695 OWNER : ${{ github.repository_owner }}
7796 REPO : ${{ github.event.repository.name }}
78- ARTIFACT_PATH : " . "
97+ ARTIFACT_PATH : " ${{ needs.release.outputs.artifact_dir }}/ "
7998 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8099 run : |
81100 echo "Scanning for files in $ARTIFACT_PATH"
0 commit comments