Skip to content

Commit 6a568f0

Browse files
authored
Meta: Update release workflow with ghat (#56)
1 parent a80939e commit 6a568f0

File tree

3 files changed

+58
-60
lines changed

3 files changed

+58
-60
lines changed

.github/workflows/deployment.yml

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

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
env: {}
2+
3+
# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/webext --set 'on.schedule=[{"cron": "22 14 * * 3"}]' --set 'jobs.Submit.strategy.matrix.command=["chrome"]'
4+
5+
name: Release
6+
on:
7+
workflow_dispatch: null
8+
schedule:
9+
- cron: 22 14 * * 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+
- chrome
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: install
43+
run: npm ci || npm install
44+
- run: npm run build
45+
- name: Update extension’s meta
46+
run: >-
47+
npx dot-json distribution/manifest.json version ${{
48+
needs.Version.outputs.version }}
49+
- run: 'npm run release:${{ matrix.command }}'
50+
env:
51+
EXTENSION_ID: '${{ secrets.EXTENSION_ID }}'
52+
CLIENT_ID: '${{ secrets.CLIENT_ID }}'
53+
CLIENT_SECRET: '${{ secrets.CLIENT_SECRET }}'
54+
REFRESH_TOKEN: '${{ secrets.REFRESH_TOKEN }}'
55+
WEB_EXT_API_KEY: '${{ secrets.WEB_EXT_API_KEY }}'
56+
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
@@ -6,10 +6,8 @@
66
"lint": "run-p lint:*",
77
"lint:css": "stylelint 'source/*.css'",
88
"lint:js": "eslint source --ext svelte",
9-
"release:cws": "webstore upload --source=distribution --auto-publish",
10-
"release": "VER=$(daily-version) run-s build version release:*",
11-
"test": "run-p 'lint:*' build",
12-
"version": "dot-json distribution/manifest.json version $VER",
9+
"release:chrome": "cd distribution && webstore upload --auto-publish",
10+
"test": "run-p lint:* build",
1311
"watch": "rollup --config --watch"
1412
},
1513
"eslintConfig": {

0 commit comments

Comments
 (0)