44
44
run : echo "latest_commit=$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" >> $GITHUB_OUTPUT
45
45
- name : Should skip release
46
46
id : should_skip_release
47
- run : echo "skip_release=$(git log --oneline -1 | grep -qE 'docs\(?.*\)?:|chore\(?.*\)?:|refactor\(?.*\)?:|test\(?.*\)?:' && echo true || echo false)" >> $GITHUB_OUTPUT
47
+ run : echo "skip_release=$(git log --oneline -1 | grep -qE 'build\(?.*\)?:| docs\(?.*\)?:|chore\(?.*\)?:|refactor\(?.*\)?:|test\(?.*\)?:' && echo true || echo false)" >> $GITHUB_OUTPUT
48
48
- name : Extract Dists
49
49
run : rsync -a . ./dist --include="*/" --include="/docs/dist/**" --include="/packages/pdk/dist/**" --exclude="*" --prune-empty-dirs
50
50
- name : Upload artifact
59
59
runs-on : ubuntu-latest
60
60
permissions :
61
61
contents : write
62
- if : needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
62
+ if : needs.release.outputs.latest_commit == github.sha
63
63
steps :
64
64
- uses : actions/setup-node@v2
65
65
with :
70
70
name : build-artifact
71
71
path : dist
72
72
- name : Release
73
+ if : needs.release.outputs.skip_release != 'true'
73
74
run : errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi
74
75
working-directory : dist/packages/pdk
75
76
env :
@@ -211,7 +212,7 @@ jobs:
211
212
title : Publishing v${{ steps.extract-version.outputs.VERSION }} to pypi failed
212
213
body : See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
213
214
release_docs :
214
- needs : release_github
215
+ needs : [release, release_github]
215
216
runs-on : ubuntu-latest
216
217
permissions :
217
218
contents : write
@@ -232,6 +233,7 @@ jobs:
232
233
git config user.name "AWS PDK Automation"
233
234
git config user.email "[email protected] "
234
235
- name : Upload docs to Github
236
+ if : needs.release.outputs.skip_release != 'true'
235
237
run : zip -r docs.zip dist/docs/dist/docs/* && gh release upload $(cat dist/packages/pdk/dist/releasetag.txt) -R $GITHUB_REPOSITORY docs.zip && rm docs.zip
236
238
env :
237
239
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments