-
Notifications
You must be signed in to change notification settings - Fork 74
74 lines (68 loc) · 2.82 KB
/
release.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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
# docs: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: 🚀 Release
on:
release: # Docs: <https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release>
types: [published]
jobs:
build:
name: Build the extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- {uses: gacts/github-slug@v1, id: slug}
- {uses: actions/setup-node@v4, with: {node-version: 21, cache: 'npm'}}
- run: npm install
- run: >
npm version --no-git-tag-version
"${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}.${{ steps.slug.outputs.version-patch }}"
- run: npm run build
- uses: actions/upload-artifact@v4
with: {name: chrome.zip, path: ./dist/chrome.zip, if-no-files-found: error, retention-days: 7}
- uses: actions/upload-artifact@v4
with: {name: firefox.zip, path: ./dist/firefox.zip, if-no-files-found: error, retention-days: 7}
upload-to-release:
name: Upload to release
runs-on: ubuntu-latest
needs: [build]
steps:
- {uses: actions/download-artifact@v4, with: {name: chrome.zip, path: dist}}
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/chrome.zip
asset_name: random-user-agent-chrome.zip
tag: ${{ github.ref }}
- {uses: actions/download-artifact@v4, with: {name: firefox.zip, path: dist}}
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/firefox.zip
asset_name: random-user-agent-firefox.zip
tag: ${{ github.ref }}
chrome:
name: Publish on Chrome Web Store
runs-on: ubuntu-latest
needs: [build]
steps:
- {uses: actions/download-artifact@v4, with: {name: chrome.zip, path: dist}}
- uses: mnao305/[email protected]
with:
file-path: dist/chrome.zip
extension-id: einpaelgookohagofgnnkcfjbkkgepnp
client-id: ${{ secrets.CHROME_WEBSTORE_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_WEBSTORE_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_WEBSTORE_REFRESH_TOKEN }}
publish: false
mozilla:
name: Publish on Mozilla Add-ons
runs-on: ubuntu-latest
needs: [build]
steps:
- {uses: actions/download-artifact@v4, with: {name: firefox.zip, path: dist}}
- uses: wdzeng/firefox-addon@v1
with:
addon-guid: '{b43b974b-1d3a-4232-b226-eaa2ac6ebb69}'
xpi-path: dist/firefox.zip
jwt-issuer: ${{ secrets.MOZILLA_ADDONS_JWT_ISSUER }}
jwt-secret: ${{ secrets.MOZILLA_ADDONS_JWT_SECRET }}