Skip to content

Commit 97e2b9d

Browse files
authored
Meta: Update release workflow with ghat (refined-github#3708)
1 parent ea6c3bf commit 97e2b9d

3 files changed

Lines changed: 57 additions & 76 deletions

File tree

.github/workflows/deployment.yml

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

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
env: {}
2+
3+
# DO NOT EDIT BELOW, USE: npx ghat fregante/ghatemplates/webext --set 'on.schedule=[{"cron": "42 17 * * 4"}]'
4+
5+
name: Release
6+
on:
7+
workflow_dispatch: null
8+
schedule:
9+
- cron: 42 17 * * 4
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+
- run: npm ci
21+
- run: npm test
22+
- uses: fregante/daily-version-action@v1
23+
name: Create tag if necessary
24+
id: daily-version
25+
- uses: notlmn/release-with-changelog@v3
26+
if: steps.daily-version.outputs.created
27+
with:
28+
token: '${{ secrets.GITHUB_TOKEN }}'
29+
exclude: true
30+
Submit:
31+
needs: Version
32+
if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
command:
37+
- firefox
38+
- chrome
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
- run: npm install
43+
- run: npm run build
44+
- name: Update extension’s meta
45+
run: >-
46+
npx dot-json distribution/manifest.json version ${{
47+
needs.Version.outputs.version }}
48+
- run: 'npm run release:${{ matrix.command }}'
49+
env:
50+
EXTENSION_ID: '${{ secrets.EXTENSION_ID }}'
51+
CLIENT_ID: '${{ secrets.CLIENT_ID }}'
52+
CLIENT_SECRET: '${{ secrets.CLIENT_SECRET }}'
53+
REFRESH_TOKEN: '${{ secrets.REFRESH_TOKEN }}'
54+
WEB_EXT_API_KEY: '${{ secrets.WEB_EXT_API_KEY }}'
55+
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
@@ -10,14 +10,12 @@
1010
"lint:css": "stylelint 'source/**/*.css'",
1111
"lint:js": "xo",
1212
"pack:safari": "xcodebuild -project 'safari/Refined GitHub.xcodeproj'",
13-
"release": "VER=$(daily-version) run-s build version release:*",
14-
"release:amo": "web-ext-submit --source-dir distribution",
15-
"release:cws": "webstore upload --source=distribution --auto-publish",
13+
"release:chrome": "cd distribution && webstore upload --auto-publish",
14+
"release:firefox": "cd distribution && web-ext-submit",
1615
"start": "web-ext run --target=chromium",
1716
"start:firefox": "web-ext run",
1817
"start:safari": "open 'safari/build/Release/Refined GitHub.app'",
1918
"test": "run-p ava lint:* build:*",
20-
"version": "dot-json distribution/manifest.json version $VER",
2119
"watch": "run-p watch:* --continue-on-error",
2220
"watch:typescript": "tsc --noEmit --watch --preserveWatchOutput",
2321
"watch:webpack": "webpack --mode=development --watch"

0 commit comments

Comments
 (0)