-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (114 loc) · 3.22 KB
/
cd.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: CD
on:
release:
types: ["published"]
jobs:
build:
name: Build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn release
- name: Upload chrome artifact
uses: actions/upload-artifact@v2
with:
path: bundle/chrome
name: chrome
- name: Upload firefox artifact
uses: actions/upload-artifact@v2
with:
path: bundle/firefox
name: firefox
- name: Upload safari artifact
uses: actions/upload-artifact@v2
with:
path: bundle/safari
name: safari
chrome:
name: Deploy to Chrome
runs-on: ubuntu-latest
needs: build
env:
EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: chrome
- name: Upload to Chrome Web Store
run: npx chrome-webstore-upload-cli upload --auto-publish
# edge:
# name: Deploy to Edge
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Download artifact
# uses: actions/download-artifact@v2
# with:
# name: chrome
firefox:
name: Deploy to Firefox
runs-on: ubuntu-latest
needs: build
env:
API_KEY: ${{ secrets.FIREFOX_API_KEY }}
API_SECRET: ${{ secrets.FIREFOX_API_SECRET }}
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: firefox
- name: Sign add-on
run: npx web-ext sign --api-key $API_KEY --api-secret $API_SECRET
- name: Upload signed add-on
uses: actions/upload-artifact@v2
with:
path: web-ext-artifacts
name: firefox-signed
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: web-ext-artifacts/*.xpi
asset_name: firefox.xpi
asset_content_type: application/x-xpinstall
- name: Trigger workflow on website
uses: benc-uk/workflow-dispatch@v1
with:
workflow: cd.yaml
repo: NIAEFEUP/nitsig-website
inputs: '{ "version": "${{ github.event.release.name }}" }'
token: ${{ secrets.GITHUB_TOKEN }}
# opera:
# name: Deploy to Opera
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Download artifact
# uses: actions/download-artifact@v2
# with:
# name: chrome
# safari:
# name: Deploy to Safari
# runs-on: macos-latest
# needs: build
# steps:
# - name: Download artifact
# uses: actions/download-artifact@v2
# with:
# name: safari
# - run: ls -R