-
Notifications
You must be signed in to change notification settings - Fork 11
156 lines (133 loc) · 4.3 KB
/
build.yml
File metadata and controls
156 lines (133 loc) · 4.3 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Build Extension
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
branches:
- main
- develop
env:
CRX_VER: v0.0.0-${{ github.sha }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Set version
if: ${{ github.ref_type == 'tag' }}
run: echo "CRX_VER=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Preparing
run: |
echo "Current version ${{ env.CRX_VER }}"
mkdir "${{ github.workspace }}/release/"
git archive --format tar.gz HEAD -o "${{ github.workspace }}/release/source.tar.gz"
- name: Build Chrome Extension
env:
SENTRY_RELEASE: ${{ env.CRX_VER }}
run: |
npm run build
cd "${{ github.workspace }}/dist/" && zip -r "${{ github.workspace }}/release/crx.zip" ./
- name: Build Firefox Add-ons
env:
SENTRY_RELEASE: ${{ env.CRX_VER }}
run: |
npm run build:firefox
cd "${{ github.workspace }}/dist/" && zip -r "${{ github.workspace }}/release/firefox.zip" ./
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Proxyverse
path: ${{ github.workspace }}/release/*
release-github:
name: Publish on Github Release
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Proxyverse
path: ${{ github.workspace }}/release/
- name: Upload to release page
uses: softprops/action-gh-release@v2
with:
files: ${{ github.workspace }}/release/*
release-chrome:
name: Publish on Chrome
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Proxyverse
path: ${{ github.workspace }}/release/
- name: Upload to Chrome Web Store
uses: wdzeng/chrome-extension@v1
with:
extension-id: igknmaflmijecdmjpcgollghmipkfbho
zip-path: ${{ github.workspace }}/release/crx.zip
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
release-edge:
name: Publish on Edge
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Proxyverse
path: ${{ github.workspace }}/release/
- name: Upload to MS Edge
uses: wdzeng/edge-addon@v2
with:
product-id: 6fa97660-6c21-41e4-87e6-06a88509753f
zip-path: ${{ github.workspace }}/release/crx.zip
client-id: ${{ secrets.EDGE_CLIENT_ID }}
api-key: ${{ secrets.EDGE_API_KEY }}
release-firefox:
name: Publish on Firefox
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Proxyverse
path: ${{ github.workspace }}/release/
- name: Upload to Firefox
uses: wdzeng/firefox-addon@v1
with:
addon-guid: proxyverse@byte.vet
xpi-path: ${{ github.workspace }}/release/firefox.zip
source-file-path: ${{ github.workspace }}/release/source.tar.gz
license: MIT
self-hosted: false
jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }}
jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }}