Skip to content

Commit 85513a3

Browse files
authored
Update release workflow (sindresorhus#250)
1 parent 74ac376 commit 85513a3

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
env: {}
1+
env:
2+
DIRECTORY: distribution
23

3-
# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/webext --set 'on.schedule=[{"cron": "21 12 * * 3"}]'
4+
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/webext
5+
# SOURCE: https://github.com/fregante/ghatemplates
6+
# OPTIONS: {"set":["on.schedule=[{\"cron\": \"21 12 * * 3\"}]"]}
47

58
name: Release
69
on:
@@ -10,8 +13,8 @@ on:
1013
jobs:
1114
Version:
1215
outputs:
13-
created: '${{ steps.daily-version.outputs.created }}'
14-
version: '${{ steps.daily-version.outputs.version }}'
16+
created: ${{ steps.daily-version.outputs.created }}
17+
version: ${{ steps.daily-version.outputs.version }}
1518
runs-on: ubuntu-latest
1619
steps:
1720
- uses: actions/checkout@v2
@@ -24,10 +27,10 @@ jobs:
2427
- uses: fregante/daily-version-action@v1
2528
name: Create tag if necessary
2629
id: daily-version
27-
- uses: notlmn/release-with-changelog@v3
30+
- uses: fregante/release-with-changelog@v3
2831
if: steps.daily-version.outputs.created
2932
with:
30-
token: '${{ secrets.GITHUB_TOKEN }}'
33+
token: ${{ secrets.GITHUB_TOKEN }}
3134
exclude: true
3235
Submit:
3336
needs: Version
@@ -43,16 +46,25 @@ jobs:
4346
- uses: actions/checkout@v2
4447
- name: install
4548
run: npm ci || npm install
46-
- run: npm run build
49+
- run: npm run build --if-present
4750
- name: Update extension’s meta
4851
run: >-
49-
npx dot-json distribution/manifest.json version ${{
52+
npx dot-json@1 $DIRECTORY/manifest.json version ${{
5053
needs.Version.outputs.version }}
51-
- run: 'npm run release:${{ matrix.command }}'
54+
- name: Submit
55+
run: |
56+
case ${{ matrix.command }} in
57+
chrome)
58+
cd $DIRECTORY && npx chrome-webstore-upload-cli@1 upload --auto-publish
59+
;;
60+
firefox)
61+
cd $DIRECTORY && npx web-ext-submit@5
62+
;;
63+
esac
5264
env:
53-
EXTENSION_ID: '${{ secrets.EXTENSION_ID }}'
54-
CLIENT_ID: '${{ secrets.CLIENT_ID }}'
55-
CLIENT_SECRET: '${{ secrets.CLIENT_SECRET }}'
56-
REFRESH_TOKEN: '${{ secrets.REFRESH_TOKEN }}'
57-
WEB_EXT_API_KEY: '${{ secrets.WEB_EXT_API_KEY }}'
58-
WEB_EXT_API_SECRET: '${{ secrets.WEB_EXT_API_SECRET }}'
65+
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
66+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
67+
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
68+
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
69+
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
70+
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}

package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
"test": "run-s lint:* test:* build",
99
"test:js": "ava",
1010
"build": "webpack --mode=production",
11-
"watch": "webpack --mode=development --watch",
12-
"release:firefox": "cd distribution && webstore upload --auto-publish",
13-
"release:chrome": "cd distribution && web-ext-submit"
11+
"watch": "webpack --mode=development --watch"
1412
},
1513
"dependencies": {
1614
"delay": "^4.3.0",
@@ -21,10 +19,7 @@
2119
"devDependencies": {
2220
"@types/chrome": "0.0.86",
2321
"ava": "^2.2.0",
24-
"chrome-webstore-upload-cli": "^1.2.0",
2522
"copy-webpack-plugin": "^5.0.4",
26-
"daily-version": "^1.0.0",
27-
"dot-json": "^1.1.0",
2823
"esm": "^3.2.25",
2924
"lodash.merge": "^4.6.2",
3025
"moment": "^2.24.0",
@@ -35,8 +30,6 @@
3530
"stylelint": "^10.1.0",
3631
"stylelint-config-xo": "^0.15.0",
3732
"terser-webpack-plugin": "^1.4.1",
38-
"web-ext": "^3.2.1",
39-
"web-ext-submit": "^3.2.1",
4033
"webpack": "^4.38.0",
4134
"webpack-cli": "^3.3.6",
4235
"xo": "^0.24.0"

0 commit comments

Comments
 (0)