-
Notifications
You must be signed in to change notification settings - Fork 525
318 lines (264 loc) · 11.4 KB
/
publish.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
name: Publish library
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'assets/**'
env:
LIBRARY_VERSION: 1.1.${{ github.run_number }}
jobs:
publish-library:
if: "!contains(github.event.head_commit.author.email, 'flubuild@microsoft.com')"
name: Publish icon libraries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Bump version patch
run: |
grep -E "[0-9]+\.[0-9]+\.[0-9]+" FluentIcons.podspec | python3 -c """
import sys
import os
current_version = sys.stdin.read().strip().split(\"'\")[1]
major, minor, patch = current_version.split('.')
os.system(f'echo \"NEW_VERSION={major}.{minor}.{int(patch) + 1}\" >> \$GITHUB_ENV')
"""
- name: Bump react version patch
run: |
grep -E "[0-9]+\.[0-9]+\.[0-9]+" ./packages/react-icons/package.json | python3 -c """
import sys
import os
current_version = sys.stdin.read().strip().split(':')[1]
current_version = current_version.split('\"')[1]
major,minor,asset = current_version.split('.')
os.system(f'echo \"REACT_VERSION={major}.{minor}.{int(asset) + 1}\" >> \$GITHUB_ENV')
"""
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in react-native-icons/package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?(-rc\.[0-9]+)?\"/\"version\": \"$REACT_VERSION\"/g" packages/react-native-icons/package.json
rm packages/react-native-icons/package.json.bk
- name: Use Node 18
uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm install
working-directory: importer
## iOS
- name: Run iOS generate script
run: npm run deploy:ios
working-directory: importer
## Flutter
- name: Run Flutter generate script
run: npm run deploy:flutter
working-directory: importer
# The name should be same as the package name on pub.dev
- name: 'fluentui_system_icons'
uses: k-paxian/dart-package-publisher@master
with:
relativePath: 'flutter'
skipTests: true
accessToken: ${{ secrets.FLUTTER_OAUTH_ACCESS_TOKEN }}
refreshToken: ${{ secrets.FLUTTER_OAUTH_REFRESH_TOKEN }}
## Publish
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version numbers in README.md
run: |
sed -i.bk -r "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" README.md
rm README.md.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version numbers in ios/README.md
run: |
sed -i.bk -r "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" ios/README.md
rm ios/README.md.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in Podspec
run: |
sed -i.bk -r "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" ios/FluentIcons.podspec
rm ios/FluentIcons.podspec.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in flutter/CHANGELOG.md
run: |
sed -i.bk -r "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" flutter/CHANGELOG.md
rm flutter/CHANGELOG.md.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in flutter/pubspec.yaml
run: |
sed -i.bk -r "s/version: [0-9]+\.[0-9]+\.[0-9]+/version: $NEW_VERSION/g" flutter/pubspec.yaml
rm flutter/pubspec.yaml.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in svg-icons/package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+\"/\"version\": \"$NEW_VERSION\"/g" packages/svg-icons/package.json
rm packages/svg-icons/package.json.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in svg-sprites/package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+\"/\"version\": \"$NEW_VERSION\"/g" packages/svg-sprites/package.json
rm packages/svg-sprites/package.json.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in react-icons/package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?(-rc\.[0-9]+)?\"/\"version\": \"$REACT_VERSION\"/g" packages/react-icons/package.json
rm packages/react-icons/package.json.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in react-native-icons/package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+\"/\"version\": \"$REACT_VERSION\"/g" packages/react-native-icons/package.json
rm packages/react-native-icons/package.json.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in react-icons-font-subsetting-webpack-plugin/package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?(-rc\.[0-9]+)?\"/\"version\": \"$REACT_VERSION\"/g" packages/react-icons-font-subsetting-webpack-plugin/package.json
rm packages/react-icons-font-subsetting-webpack-plugin/package.json.bk
- name: Install dependencies
run: npm install
- name: Build SVG library
run: |
npm run build
working-directory: packages/svg-icons
- name: Build SVG sprite library
run: |
npm run build
working-directory: packages/svg-sprites
- name: Build React library
run: |
npm run build
working-directory: packages/react-icons
- name: Build Webpack plugin library
run: |
npm run build
working-directory: packages/react-icons-font-subsetting-webpack-plugin
- name: Build React-Native library
run: |
npm run build
working-directory: packages/react-native-icons
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/svg-icons/package.json
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/svg-sprites/package.json
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/react-icons/package.json
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/react-icons-font-subsetting-webpack-plugin/package.json
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/react-native-icons/package.json
## Android
# - name: Run Android generate script
# env:
# # see https://github.com/JS-DevTools/npm-publish/issues/15
# INPUT_TOKEN: ''
# run: npm run deploy:android
# working-directory: importer
# - name: Setup Java
# uses: actions/setup-java@v1
# with:
# java-version: 8
# - name: Base64 decodes and pipes the GPG key content into the secret file
# env:
# GPG_KEY_CONTENT: ${{ secrets.GPG_KEY_CONTENT }}
# SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
# run: |
# git fetch --unshallow
# sudo bash -c "echo '$GPG_KEY_CONTENT' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
# - name: Build Android library
# uses: eskatos/gradle-command-action@v1
# with:
# arguments: assembleRelease -DversionName='${{ env.NEW_VERSION }}'
# build-root-directory: android
# wrapper-directory: android
# Temporarily commenting out the publishing to Maven Central, as it is blocking the release for other platforms
# - name: Publish to Maven Central
# uses: eskatos/gradle-command-action@v1
# env:
# OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
# GPG_SIGNING_KEY_ID: ${{ secrets.GPG_SIGNING_KEY_ID }}
# GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
# SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
# SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
# VERSION_NAME: ${{ env.NEW_VERSION }}
# with:
# arguments: publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
# build-root-directory: android
# wrapper-directory: android
# - name: Generate BUILD.gn file for Android
# run: python3 generate_build_gn_android.py
# working-directory: importer
- name: Update icon sheet
run: python3 generate_icons_md.py
- name: Config git credentials
run: git config user.email "flubuild@microsoft.com" && git config user.name "Fluent Build System"
- name: Commit version number change
run: |
git add -A
git commit -m "Release $NEW_VERSION"
- name: Tag release
run: git tag "$NEW_VERSION"
- name: Push release
run: |
REMOTE_REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push $REMOTE_REPO HEAD:main --follow-tags --tags
# publish-android-demo:
# name: Publish Android demo app
# runs-on: ubuntu-latest
# needs: publish-library
# steps:
# - uses: actions/checkout@v2
# - name: Bump version patch
# run: |
# grep -E "[0-9]+\.[0-9]+\.[0-9]+" FluentIcons.podspec | python3 -c """
# import sys
# import os
# current_version = sys.stdin.read().strip().split(\"'\")[1]
# major, minor, patch = current_version.split('.')
# os.system(f'echo \"NEW_VERSION={major}.{minor}.{int(patch) + 1}\" >> \$GITHUB_ENV')
# """
# - name: Use Node 11
# uses: actions/setup-node@v1
# with:
# node-version: 11.x
# - run: npm install
# working-directory: importer
# - name: Run generate script
# run: npm run deploy:android
# working-directory: importer
# - name: Setup Java
# uses: actions/setup-java@v1
# with:
# java-version: 8
# - name: Restore release keystore
# run: |
# echo "${{ secrets.ANDROID_KEYSTORE }}" > release.keystore.asc
# gpg -d --passphrase "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" --batch release.keystore.asc > release.keystore
# - name: Build Android demo app
# uses: eskatos/gradle-command-action@v1
# with:
# arguments: ':sample-showcase:assembleRelease -DversionName=${{ env.NEW_VERSION }} -DversionCode=${{ github.run_number }} -Pandroid.injected.signing.store.file=/home/runner/work/fluentui-system-icons/fluentui-system-icons/release.keystore -Pandroid.injected.signing.store.password=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.ANDROID_KEYSTORE_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}'
# build-root-directory: android
# wrapper-directory: android
# - name: Publish apk to App Center
# uses: wzieba/AppCenter-Github-Action@v1.0.0
# with:
# appName: ${{ secrets.APP_CENTER_DEMO_APP_NAME }}
# token: ${{ secrets.APP_CENTER_TOKEN }}
# group: Public
# file: android/sample-showcase/build/outputs/apk/release/sample-showcase-release.apk
# releaseNotes: Please enjoy this latest version(${{ env.NEW_VERSION }}) of Fluent System Icons Demo.