@@ -21,10 +21,11 @@ jobs:
2121 gem_name : ${{ steps.build.outputs.gem_name }}
2222 gem_version : ${{ steps.build.outputs.gem_version }}
2323 gem_path : ${{ steps.build.outputs.gem_path }}
24+ artifact_dir : ${{ steps.build.outputs.artifact_dir }}
2425
2526 steps :
2627 - name : checkout
27- uses : actions/checkout@v4
28+ uses : actions/checkout@4.2.2
2829 with :
2930 persist-credentials : false
3031
3940 # gem_name: the name of the gem - ex: "my-cool-gem"
4041 # gem_version: the version of the gem - ex: "1.0.0"
4142 # gem_path: the path/filename of the gem - ex: "my-cool-gem-1.0.0.gem"
43+ # artifact_dir: the directory where the gem is stored - ex: "dist" (a directory)
4244 - name : build
4345 id : build
4446 run : script/build
47494850 id : upload-artifact
4951 with :
50- path : " ${{ steps.build.outputs.gem_path }}"
52+ name : ${{ steps.build.outputs.artifact_dir }}
53+ path : ${{ steps.build.outputs.artifact_dir }}
54+ if-no-files-found : error
5155
5256 release :
5357 needs : build
@@ -62,19 +66,25 @@ jobs:
6266 with :
6367 persist-credentials : false
6468
65- - uses : actions/download-artifact@4.3 .0
69+ - uses : actions/download-artifact@5.0 .0
6670 with :
71+ path : ${{ needs.build.outputs.artifact_dir }}
6772 artifact-ids : ${{ needs.build.outputs.artifact-id }}
6873
74+ - name : view artifact
75+ env :
76+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
77+ run : tree -L 2 -a --dirsfirst -C -F -h -D "${ARTIFACT_PATH}"
78+
6979 - name : Publish to GitHub Packages
7080 env :
7181 OWNER : ${{ github.repository_owner }}
7282 GEM_NAME : ${{ needs.build.outputs.gem_name }}
7383 GEM_VERSION : ${{ needs.build.outputs.gem_version }}
7484 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75- ARTIFACT_PATH : " artifact "
85+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
7686 run : |
77- GEM_HOST_API_KEY=${GITHUB_TOKEN} gem push --key github --host https://rubygems.pkg.github.com/${OWNER} $ARTIFACT_PATH/${GEM_NAME}-${GEM_VERSION}.gem
87+ GEM_HOST_API_KEY=${GITHUB_TOKEN} gem push --key github --host https://rubygems.pkg.github.com/${OWNER} ${ ARTIFACT_PATH} /${GEM_NAME}-${GEM_VERSION}.gem
7888
7989 -
uses :
ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # [email protected] 8090 with :
@@ -90,14 +100,14 @@ jobs:
90100 env :
91101 GEM_NAME : ${{ needs.build.outputs.gem_name }}
92102 GEM_VERSION : ${{ needs.build.outputs.gem_version }}
93- ARTIFACT_PATH : " artifact "
103+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
94104 run : bundle exec sigstore-cli sign ${ARTIFACT_PATH}/${GEM_NAME}-${GEM_VERSION}.gem --bundle ${GEM_NAME}-${GEM_VERSION}.sigstore.json
95105
96106 - name : Publish to RubyGems
97107 env :
98108 GEM_NAME : ${{ needs.build.outputs.gem_name }}
99109 GEM_VERSION : ${{ needs.build.outputs.gem_version }}
100- ARTIFACT_PATH : " artifact "
110+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
101111 run : gem push ${ARTIFACT_PATH}/${GEM_NAME}-${GEM_VERSION}.gem --attestation ${GEM_NAME}-${GEM_VERSION}.sigstore.json
102112
103113 - name : await gem
@@ -111,7 +121,7 @@ jobs:
111121 GEM_NAME : ${{ needs.build.outputs.gem_name }}
112122 GEM_VERSION : ${{ needs.build.outputs.gem_version }}
113123 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114- ARTIFACT_PATH : " artifact "
124+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
115125 run : |
116126 gh release create "v${GEM_VERSION}" \
117127 "${ARTIFACT_PATH}/${GEM_NAME}-${GEM_VERSION}.gem" \
@@ -128,29 +138,31 @@ jobs:
128138 contents : read
129139
130140 steps :
131- - uses : actions/download-artifact@4.3 .0
141+ - uses : actions/download-artifact@5.0 .0
132142 with :
143+ path : ${{ needs.build.outputs.artifact_dir }}
133144 artifact-ids : ${{ needs.build.outputs.artifact-id }}
134145
135146 - name : attest build provenance
136147137148 with :
138- subject-path : " artifact /${{ needs.build.outputs.gem_path }}"
149+ subject-path : " ${{ needs.build.outputs.artifact_dir }} /${{ needs.build.outputs.gem_path }}"
139150
140151 verify :
141152 permissions : {}
142153 needs : [build, release, sign]
143154 runs-on : ubuntu-latest
144155
145156 steps :
146- - uses : actions/download-artifact@4.3 .0
157+ - uses : actions/download-artifact@5.0 .0
147158 with :
159+ path : ${{ needs.build.outputs.artifact_dir }}
148160 artifact-ids : ${{ needs.build.outputs.artifact-id }}
149161
150162 - name : verify
151163 env :
152164 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153165 OWNER : ${{ github.repository_owner }}
154166 REPO : ${{ github.event.repository.name }}
155- ARTIFACT_PATH : " artifact /${{ needs.build.outputs.gem_path }}"
167+ ARTIFACT_PATH : " ${{ needs.build.outputs.artifact_dir }} /${{ needs.build.outputs.gem_path }}"
156168 run : gh attestation verify "$ARTIFACT_PATH" --repo ${OWNER}/${REPO} --signer-workflow ${OWNER}/${REPO}/.github/workflows/release.yml
0 commit comments