21
21
gem_name : ${{ steps.build.outputs.gem_name }}
22
22
gem_version : ${{ steps.build.outputs.gem_version }}
23
23
gem_path : ${{ steps.build.outputs.gem_path }}
24
+ artifact_dir : ${{ steps.build.outputs.artifact_dir }}
24
25
25
26
steps :
26
27
- name : checkout
39
40
# gem_name: the name of the gem - ex: "my-cool-gem"
40
41
# gem_version: the version of the gem - ex: "1.0.0"
41
42
# gem_path: the path/filename of the gem - ex: "my-cool-gem-1.0.0.gem"
43
+ # artifact_dir: the path to the dir where artifacts are stored - ex: "dist"
42
44
- name : build
43
45
id : build
44
46
run : script/build
47
49
uses :
actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # [email protected]
48
50
id : upload-artifact
49
51
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
51
55
52
56
release :
53
57
needs : build
@@ -65,14 +69,20 @@ jobs:
65
69
-
uses :
actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # [email protected]
66
70
with :
67
71
artifact-ids : ${{ needs.build.outputs.artifact-id }}
72
+ path : ${{ needs.build.outputs.artifact_dir }}
73
+
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}"
68
78
69
79
- name : Publish to GitHub Packages
70
80
env :
71
81
OWNER : ${{ github.repository_owner }}
72
82
GEM_NAME : ${{ needs.build.outputs.gem_name }}
73
83
GEM_VERSION : ${{ needs.build.outputs.gem_version }}
74
84
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
- ARTIFACT_PATH : " artifact "
85
+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
76
86
run : |
77
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
78
88
@@ -90,14 +100,14 @@ jobs:
90
100
env :
91
101
GEM_NAME : ${{ needs.build.outputs.gem_name }}
92
102
GEM_VERSION : ${{ needs.build.outputs.gem_version }}
93
- ARTIFACT_PATH : " artifact "
103
+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
94
104
run : bundle exec sigstore-cli sign ${ARTIFACT_PATH}/${GEM_NAME}-${GEM_VERSION}.gem --bundle ${GEM_NAME}-${GEM_VERSION}.sigstore.json
95
105
96
106
- name : Publish to RubyGems
97
107
env :
98
108
GEM_NAME : ${{ needs.build.outputs.gem_name }}
99
109
GEM_VERSION : ${{ needs.build.outputs.gem_version }}
100
- ARTIFACT_PATH : " artifact "
110
+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
101
111
run : gem push ${ARTIFACT_PATH}/${GEM_NAME}-${GEM_VERSION}.gem --attestation ${GEM_NAME}-${GEM_VERSION}.sigstore.json
102
112
103
113
- name : await gem
@@ -111,7 +121,7 @@ jobs:
111
121
GEM_NAME : ${{ needs.build.outputs.gem_name }}
112
122
GEM_VERSION : ${{ needs.build.outputs.gem_version }}
113
123
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114
- ARTIFACT_PATH : " artifact "
124
+ ARTIFACT_PATH : ${{ needs.build.outputs.artifact_dir }}
115
125
run : |
116
126
gh release create "v${GEM_VERSION}" \
117
127
"${ARTIFACT_PATH}/${GEM_NAME}-${GEM_VERSION}.gem" \
@@ -130,12 +140,13 @@ jobs:
130
140
steps :
131
141
-
uses :
actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # [email protected]
132
142
with :
143
+ path : ${{ needs.build.outputs.artifact_dir }}
133
144
artifact-ids : ${{ needs.build.outputs.artifact-id }}
134
145
135
146
- name : attest build provenance
136
147
uses :
actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # [email protected]
137
148
with :
138
- subject-path : " artifact /${{ needs.build.outputs.gem_path }}"
149
+ subject-path : " ${{ needs.build.outputs.artifact_dir }} /${{ needs.build.outputs.gem_path }}"
139
150
140
151
verify :
141
152
permissions : {}
@@ -145,12 +156,13 @@ jobs:
145
156
steps :
146
157
-
uses :
actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # [email protected]
147
158
with :
159
+ path : ${{ needs.build.outputs.artifact_dir }}
148
160
artifact-ids : ${{ needs.build.outputs.artifact-id }}
149
161
150
162
- name : verify
151
163
env :
152
164
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153
165
OWNER : ${{ github.repository_owner }}
154
166
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 }}"
156
168
run : gh attestation verify "$ARTIFACT_PATH" --repo ${OWNER}/${REPO} --signer-workflow ${OWNER}/${REPO}/.github/workflows/release.yml
0 commit comments