-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (71 loc) · 2.57 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
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Update manifest versions
id: update_manifests
run: |
RELEASE_VERSION=${{ github.event.release.tag_name }}
RELEASE_VERSION=${RELEASE_VERSION#v} # Strip the 'v' prefix
jq --arg version "$RELEASE_VERSION" '.version = $version' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
jq --arg version "$RELEASE_VERSION" '.version = $version' manifest-v2.json > manifest-v2.tmp && mv manifest-v2.tmp manifest-v2.json
- name: Verify release version
id: verify_version
run: |
RELEASE_VERSION=${{ github.event.release.tag_name }}
RELEASE_VERSION=${RELEASE_VERSION#v} # Strip the 'v' prefix
MANIFEST_VERSION=$(jq -r '.version' manifest.json)
MANIFEST_V2_VERSION=$(jq -r '.version' manifest-v2.json)
if [[ "$RELEASE_VERSION" != "$MANIFEST_VERSION" || "$RELEASE_VERSION" != "$MANIFEST_V2_VERSION" ]]; then
echo "Release version does not match manifest versions"
exit 1
fi
- name: Build permissions
run: chmod +x *build.sh
- name: Run build script
run: ./build.sh
- name: Inspect build
run: ./inspect-build.sh
- name: Post Build
run: ./post-build.sh
- name: Upload Chromium zip as artifact
uses: actions/upload-artifact@v3
with:
name: chromium-zip
path: dist/chromium.zip
- name: Upload Firefox zip as artifact
uses: actions/upload-artifact@v3
with:
name: firefox-zip
path: dist/firefox.zip
- name: Upload Chromium zip to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/chromium.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Firefox zip to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/firefox.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}