-
-
Notifications
You must be signed in to change notification settings - Fork 11
237 lines (199 loc) · 15.3 KB
/
release-please.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
on:
push:
branches:
- main
name: release-please
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
# Output which releases were created
- name: Output release info
run: |
echo "releases_created:" ${{ steps.release.outputs.releases_created }}
echo "packages/compat--release_created:" ${{ steps.release.outputs['packages/compat--release_created'] }}
echo "packages/object-schema--release_created:" ${{ steps.release.outputs['packages/object-schema--release_created'] }}
echo "packages/config-array--release_created" ${{ steps.release.outputs['packages/config-array--release_created'] }}
# Check to see if we need to do any releases and if so check out the repo
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created == 'true' }}
# Node.js release
- uses: actions/setup-node@v4
if: ${{ steps.release.outputs.releases_created == 'true' }}
with:
node-version: lts/*
registry-url: "https://registry.npmjs.org"
- run: |
npm install
npm run build
if: ${{ steps.release.outputs.releases_created == 'true' }}
#-----------------------------------------------------------------------------
# NOTE: Packages are released in order of dependency. The packages with the
# fewest internal dependencies are released first and the packages with the
# most internal dependencies are released last.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# @eslint/compat
#-----------------------------------------------------------------------------
- name: Publish @eslint/compat package to npm
run: npm publish -w packages/compat --provenance
if: ${{ steps.release.outputs['packages/compat--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish @eslint/compat package to JSR
run: |
npm run build --if-present
npx jsr publish
working-directory: packages/compat
if: ${{ steps.release.outputs['packages/compat--release_created'] }}
- name: Tweet Release Announcement
run: npx @humanwhocodes/tweet "eslint/compat v${{ steps.release.outputs['packages/compat--major'] }}.${{ steps.release.outputs['packages/compat--minor'] }}.${{ steps.release.outputs['packages/compat--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/compat--tag_name'] }}"
if: ${{ steps.release.outputs['packages/compat--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Toot Release Announcement
run: npx @humanwhocodes/toot "eslint/compat v${{ steps.release.outputs['packages/compat--major'] }}.${{ steps.release.outputs['packages/compat--minor'] }}.${{ steps.release.outputs['packages/compat--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/compat--tag_name'] }}"
if: ${{ steps.release.outputs['packages/compat--release_created'] }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
#-----------------------------------------------------------------------------
# @eslint/core
#-----------------------------------------------------------------------------
- name: Publish @eslint/core package to npm
run: npm publish -w packages/core --provenance
if: ${{ steps.release.outputs['packages/core--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish @eslint/core package to JSR
run: |
npm run build --if-present
npx jsr publish
working-directory: packages/core
if: ${{ steps.release.outputs['packages/core--release_created'] }}
- name: Tweet Release Announcement
run: npx @humanwhocodes/tweet "eslint/core v${{ steps.release.outputs['packages/core--major'] }}.${{ steps.release.outputs['packages/core--minor'] }}.${{ steps.release.outputs['packages/core--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/core--tag_name'] }}"
if: ${{ steps.release.outputs['packages/core--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Toot Release Announcement
run: npx @humanwhocodes/toot "eslint/core v${{ steps.release.outputs['packages/core--major'] }}.${{ steps.release.outputs['packages/core--minor'] }}.${{ steps.release.outputs['packages/core--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/core--tag_name'] }}"
if: ${{ steps.release.outputs['packages/core--release_created'] }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
#-----------------------------------------------------------------------------
# @eslint/migrate-config
#-----------------------------------------------------------------------------
- name: Publish @eslint/migrate-config package to npm
run: npm publish -w packages/migrate-config --provenance
if: ${{ steps.release.outputs['packages/migrate-config--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# NOTE: No JSR package because JSR doesn't support CLIs
- name: Tweet Release Announcement
run: npx @humanwhocodes/tweet "eslint/migrate-config v${{ steps.release.outputs['packages/migrate-config--major'] }}.${{ steps.release.outputs['packages/migrate-config--minor'] }}.${{ steps.release.outputs['packages/migrate-config--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/migrate-config--tag_name'] }}"
if: ${{ steps.release.outputs['packages/migrate-config--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Toot Release Announcement
run: npx @humanwhocodes/toot "eslint/migrate-config v${{ steps.release.outputs['packages/migrate-config--major'] }}.${{ steps.release.outputs['packages/migrate-config--minor'] }}.${{ steps.release.outputs['packages/migrate-config--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/migrate-config--tag_name'] }}"
if: ${{ steps.release.outputs['packages/migrate-config--release_created'] }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
#-----------------------------------------------------------------------------
# @eslint/object-schema
#-----------------------------------------------------------------------------
- name: Publish @eslint/object-schema package to npm
run: npm publish -w packages/object-schema --provenance
if: ${{ steps.release.outputs['packages/object-schema--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish @eslint/object-schema package to JSR
run: npx jsr publish
working-directory: packages/object-schema
if: ${{ steps.release.outputs['packages/object-schema--release_created'] }}
- name: Tweet Release Announcement
run: npx @humanwhocodes/tweet "eslint/object-schema v${{ steps.release.outputs['packages/object-schema--major'] }}.${{ steps.release.outputs['packages/object-schema--minor'] }}.${{ steps.release.outputs['packages/object-schema--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/object-schema--tag_name'] }}"
if: ${{ steps.release.outputs['packages/object-schema--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Toot Release Announcement
run: npx @humanwhocodes/toot "eslint/object-schema v${{ steps.release.outputs['packages/object-schema--major'] }}.${{ steps.release.outputs['packages/object-schema--minor'] }}.${{ steps.release.outputs['packages/object-schema--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/object-schema--tag_name'] }}"
if: ${{ steps.release.outputs['packages/object-schema--release_created'] }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
#-----------------------------------------------------------------------------
# @eslint/config-array
#-----------------------------------------------------------------------------
- name: Publish @eslint/config-array package to npm
run: npm publish -w packages/config-array --provenance
if: ${{ steps.release.outputs['packages/config-array--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish @eslint/config-array package to JSR
run: npx jsr publish
working-directory: packages/config-array
if: ${{ steps.release.outputs['packages/config-array--release_created'] }}
- name: Tweet Release Announcement
run: npx @humanwhocodes/tweet "eslint/config-array v${{ steps.release.outputs['packages/config-array--major'] }}.${{ steps.release.outputs['packages/config-array--minor'] }}.${{ steps.release.outputs['packages/config-array--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/config-array--tag_name'] }}"
if: ${{ steps.release.outputs['packages/config-array--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Toot Release Announcement
run: npx @humanwhocodes/toot "eslint/config-array v${{ steps.release.outputs['packages/config-array--major'] }}.${{ steps.release.outputs['packages/config-array--minor'] }}.${{ steps.release.outputs['packages/config-array--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/config-array--tag_name'] }}"
if: ${{ steps.release.outputs['packages/config-array--release_created'] }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
#-----------------------------------------------------------------------------
# @eslint/plugin-kit
#-----------------------------------------------------------------------------
- name: Publish @eslint/plugin-kit package to npm
run: npm publish -w packages/plugin-kit --provenance
if: ${{ steps.release.outputs['packages/plugin-kit--release_created'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish @eslint/plugin-kit package to JSR
run: npx jsr publish
working-directory: packages/plugin-kit
if: ${{ steps.release.outputs['packages/plugin-kit--release_created'] }}
- name: Tweet Release Announcement
run: npx @humanwhocodes/tweet "eslint/plugin-kit v${{ steps.release.outputs['packages/plugin-kit--major'] }}.${{ steps.release.outputs['packages/plugin-kit--minor'] }}.${{ steps.release.outputs['packages/plugin-kit--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/plugin-kit--tag_name'] }}"
if: ${{ steps.release.outputs['packages/plugin-kit--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Toot Release Announcement
run: npx @humanwhocodes/toot "eslint/plugin-kit v${{ steps.release.outputs['packages/plugin-kit--major'] }}.${{ steps.release.outputs['packages/plugin-kit--minor'] }}.${{ steps.release.outputs['packages/plugin-kit--patch'] }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs['packages/plugin-kit--tag_name'] }}"
if: ${{ steps.release.outputs['packages/plugin-kit--release_created'] }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}