15
15
contents : write
16
16
outputs :
17
17
latest_commit : ${{ steps.git_remote.outputs.latest_commit }}
18
+ skip_release : ${{ steps.should_skip_release.outputs.skip_release }}
18
19
env :
19
20
CI : " true"
20
21
steps :
41
42
- name : Check for new commits
42
43
id : git_remote
43
44
run : echo "latest_commit=$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" >> $GITHUB_OUTPUT
45
+ - name : Should skip release
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
44
48
- name : Extract Dists
45
49
run : rsync -a . ./dist --include="*/" --include="/docs/dist/**" --include="/packages/pdk/dist/**" --exclude="*" --prune-empty-dirs
46
50
- name : Upload artifact
55
59
runs-on : ubuntu-latest
56
60
permissions :
57
61
contents : write
58
- if : needs.release.outputs.latest_commit == github.sha
62
+ if : needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
59
63
steps :
60
64
- uses : actions/setup-node@v2
61
65
with :
77
81
needs : release
78
82
runs-on : ubuntu-latest
79
83
permissions :
84
+ id-token : write
85
+ issues : write
80
86
contents : read
81
- if : needs.release.outputs.latest_commit == github.sha
87
+ if : needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
82
88
steps :
83
89
- name : Install Node.js
84
90
uses : actions/setup-node@v3
@@ -95,16 +101,32 @@ jobs:
95
101
working-directory : dist/packages/pdk
96
102
run : pnpm --package publib@latest dlx publib-npm
97
103
env :
104
+ NPM_CONFIG_PROVENANCE : " true"
98
105
NPM_DIST_TAG : latest
99
106
NPM_REGISTRY : registry.npmjs.org
100
107
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
108
+ - name : Extract Version
109
+ id : extract-version
110
+ working-directory : dist/packages/pdk
111
+ if : ${{ failure() }}
112
+ run : echo "VERSION=$(cat dist/releasetag.txt)" >> $GITHUB_OUTPUT
113
+ - name : Create Issue
114
+ if : ${{ failure() }}
115
+ uses : imjohnbo/issue-bot@v3
116
+ env :
117
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118
+ with :
119
+ labels : failed-release
120
+ title : Publishing v${{ steps.extract-version.outputs.VERSION }} to npm failed
121
+ body : See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
101
122
release_maven :
102
123
name : Publish to Maven Central
103
124
needs : release
104
125
runs-on : ubuntu-latest
105
126
permissions :
127
+ issues : write
106
128
contents : read
107
- if : needs.release.outputs.latest_commit == github.sha
129
+ if : needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
108
130
steps :
109
131
- uses : actions/setup-java@v2
110
132
with :
@@ -131,13 +153,28 @@ jobs:
131
153
MAVEN_PASSWORD : ${{ secrets.MAVEN_PASSWORD }}
132
154
MAVEN_USERNAME : ${{ secrets.MAVEN_USERNAME }}
133
155
MAVEN_STAGING_PROFILE_ID : ${{ secrets.MAVEN_STAGING_PROFILE_ID }}
156
+ - name : Extract Version
157
+ id : extract-version
158
+ working-directory : dist/packages/pdk
159
+ if : ${{ failure() }}
160
+ run : echo "VERSION=$(cat dist/releasetag.txt)" >> $GITHUB_OUTPUT
161
+ - name : Create Issue
162
+ if : ${{ failure() }}
163
+ uses : imjohnbo/issue-bot@v3
164
+ env :
165
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
166
+ with :
167
+ labels : failed-release
168
+ title : Publishing v${{ steps.extract-version.outputs.VERSION }} to maven failed
169
+ body : See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
134
170
release_pypi :
135
171
name : Publish to PyPI
136
172
needs : release
137
173
runs-on : ubuntu-latest
138
174
permissions :
139
175
contents : read
140
- if : needs.release.outputs.latest_commit == github.sha
176
+ issues : write
177
+ if : needs.release.outputs.latest_commit == github.sha && needs.release.outputs.skip_release != 'true'
141
178
steps :
142
179
- name : Install Node.js
143
180
uses : actions/setup-node@v3
@@ -159,6 +196,20 @@ jobs:
159
196
env :
160
197
TWINE_USERNAME : ${{ secrets.TWINE_USERNAME }}
161
198
TWINE_PASSWORD : ${{ secrets.TWINE_PASSWORD }}
199
+ - name : Extract Version
200
+ id : extract-version
201
+ working-directory : dist/packages/pdk
202
+ if : ${{ failure() }}
203
+ run : echo "VERSION=$(cat dist/releasetag.txt)" >> $GITHUB_OUTPUT
204
+ - name : Create Issue
205
+ if : ${{ failure() }}
206
+ uses : imjohnbo/issue-bot@v3
207
+ env :
208
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
209
+ with :
210
+ labels : failed-release
211
+ title : Publishing v${{ steps.extract-version.outputs.VERSION }} to pypi failed
212
+ body : See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
162
213
release_docs :
163
214
needs : release_github
164
215
runs-on : ubuntu-latest
0 commit comments