-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
71 lines (65 loc) · 2.07 KB
/
deployment.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
# Copied from https://github.com/notlmn/browser-extension-template/blob/master/.github/workflows/deployment.yml
name: Deployment
on:
workflow_dispatch:
# You can manually trigger a deployment on GitHub.com
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
schedule:
- cron: '42 17 * * 4'
jobs:
Version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.daily-version.outputs.version }}
created: ${{ steps.daily-version.outputs.created }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 20
- uses: fregante/daily-version-action@v1
name: Create tag if necessary
id: daily-version
- uses: notlmn/release-with-changelog@v2
with:
include-range: false
token: ${{ secrets.GITHUB_TOKEN }}
Build:
needs: Version
if: github.event_name == 'push' || needs.Version.outputs.created
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm test
- name: Update extension’s meta
env:
VER: ${{ needs.Version.outputs.version }}
run: |
echo https://github.com/$GITHUB_REPOSITORY/tree/$VER > distribution/SOURCE_URL.txt
npm run version
- uses: actions/upload-artifact@v2
with:
path: distribution
Chrome:
needs: Build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- run: cd artifact && npx chrome-webstore-upload-cli@1 upload --auto-publish
env:
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
Firefox:
needs: Build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- run: cd artifact && npx web-ext-submit@4
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}