@@ -156,33 +156,27 @@ jobs:
156
156
release :
157
157
name : Create GitHub release
158
158
needs : [build, shellcheck]
159
- if : github.event_name == 'push' && contains (github.ref, 'refs/tags/')
159
+ if : github.event_name == 'push' && startsWith (github.ref, 'refs/tags/')
160
160
runs-on : ubuntu-latest
161
161
permissions :
162
162
contents : write
163
163
steps :
164
164
- uses : actions/checkout@v4
165
165
166
166
- name : Download all artifacts
167
- uses : actions/download-artifact@v4
167
+ uses : actions/download-artifact@v3
168
168
with :
169
169
path : ' ./artifacts'
170
170
171
171
- name : Display structure of downloaded files
172
172
run : ls -R
173
173
working-directory : ' ./artifacts'
174
174
175
- - name : Get tag name without prefix
176
- run : |
177
- DUGITE_TAG=${GITHUB_REF/refs\/tags\//}
178
- echo "DUGITE_TAG=${DUGITE_TAG}" >> $GITHUB_ENV
179
- tagNameWithoutPrefix="${DUGITE_TAG:1}"
180
- echo "DUGITE_TAG_WITHOUT_PREFIX=${tagNameWithoutPrefix}" >> $GITHUB_ENV
181
-
182
175
- name : Generate release notes
183
176
run : |
184
177
npm ci
185
- node -r ts-node/register script/generate-release-notes.ts "${{ github.workspace }}/artifacts" "${{ env.DUGITE_TAG }}" "${{ secrets.GITHUB_TOKEN }}"
178
+ DUGITE_TAG=${GITHUB_REF/refs\/tags\//}
179
+ node -r ts-node/register script/generate-release-notes.ts "${{ github.workspace }}/artifacts" "$DUGITE_TAG" "${{ secrets.GITHUB_TOKEN }}"
186
180
RELEASE_NOTES_FILE=script/release_notes.txt
187
181
if [[ ! -f "$RELEASE_NOTES_FILE" ]]; then
188
182
echo "$RELEASE_NOTES_FILE does not exist. Something might have gone wrong while generating the release notes."
@@ -192,25 +186,11 @@ jobs:
192
186
cat ${RELEASE_NOTES_FILE} >> $GITHUB_ENV
193
187
echo 'EOF' >> $GITHUB_ENV
194
188
195
- - name : Create release
196
- id : create_release
197
- uses : actions/create-release@v1
198
- env :
199
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
189
+ - name : Release
190
+ uses : softprops/action-gh-release@v2
200
191
with :
201
- tag_name : ${{ github.ref }}
202
- release_name : Git ${{ env.DUGITE_TAG_WITHOUT_PREFIX }}
203
192
body : ${{ env.DUGITE_RELEASE_NOTES }}
204
193
draft : true
205
194
prerelease : false
206
-
207
- - name : Upload release assets
208
- uses : actions/github-script@v3
209
- with :
210
- github-token : ${{ secrets.GITHUB_TOKEN }}
211
- # Workaround since actions/upload-release-asset doesn't support wildcard paths
212
- script : |
213
- const script = require(`${process.env.GITHUB_WORKSPACE}/script/create-release.js`);
214
- const artifactsDir = `${process.env.GITHUB_WORKSPACE}/artifacts`;
215
- const releaseId = '${{ steps.create_release.outputs.id }}';
216
- console.log(script({github, context, artifactsDir, releaseId}));
195
+ files : ${{ github.workspace }}/artifacts/**/*
196
+ fail_on_unmatched_files : true
0 commit comments