Skip to content

Commit c9c66fe

Browse files
authored
Meta: Update release workflow (sindresorhus#236)
1 parent a6621d8 commit c9c66fe

File tree

3 files changed

+59
-67
lines changed

3 files changed

+59
-67
lines changed

.github/workflows/deployment.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
env: {}
2+
3+
# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/webext --set 'on.schedule=[{"cron": "21 12 * * 3"}]'
4+
5+
name: Release
6+
on:
7+
workflow_dispatch: null
8+
schedule:
9+
- cron: 21 12 * * 3
10+
jobs:
11+
Version:
12+
outputs:
13+
created: '${{ steps.daily-version.outputs.created }}'
14+
version: '${{ steps.daily-version.outputs.version }}'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 20
20+
- name: install
21+
run: npm ci || npm install
22+
- run: npm test
23+
- uses: fregante/daily-version-action@v1
24+
name: Create tag if necessary
25+
id: daily-version
26+
- uses: notlmn/release-with-changelog@v3
27+
if: steps.daily-version.outputs.created
28+
with:
29+
token: '${{ secrets.GITHUB_TOKEN }}'
30+
exclude: true
31+
Submit:
32+
needs: Version
33+
if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
command:
38+
- firefox
39+
- chrome
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: install
44+
run: npm ci || npm install
45+
- run: npm run build
46+
- name: Update extension’s meta
47+
run: >-
48+
npx dot-json distribution/manifest.json version ${{
49+
needs.Version.outputs.version }}
50+
- run: 'npm run release:${{ matrix.command }}'
51+
env:
52+
EXTENSION_ID: '${{ secrets.EXTENSION_ID }}'
53+
CLIENT_ID: '${{ secrets.CLIENT_ID }}'
54+
CLIENT_SECRET: '${{ secrets.CLIENT_SECRET }}'
55+
REFRESH_TOKEN: '${{ secrets.REFRESH_TOKEN }}'
56+
WEB_EXT_API_KEY: '${{ secrets.WEB_EXT_API_KEY }}'
57+
WEB_EXT_API_SECRET: '${{ secrets.WEB_EXT_API_SECRET }}'

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
"test:js": "ava",
1010
"build": "webpack --mode=production",
1111
"watch": "webpack --mode=development --watch",
12-
"version": "dot-json distribution/manifest.json version $VER",
13-
"release:cws": "webstore upload --source=distribution --auto-publish",
14-
"release:amo": "web-ext-submit --source-dir distribution",
15-
"release": "VER=$(daily-version) run-s build version release:*"
12+
"release:firefox": "cd distribution && webstore upload --auto-publish",
13+
"release:chrome": "cd distribution && web-ext-submit"
1614
},
1715
"dependencies": {
1816
"delay": "^4.3.0",

0 commit comments

Comments
 (0)