-
-
Notifications
You must be signed in to change notification settings - Fork 171
53 lines (51 loc) · 2.02 KB
/
main.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
name: Sign webextension
on:
push:
branches: master
paths: [ "ophirofox/**", ".github/workflows/main.yml" ]
defaults:
run:
working-directory: ./ophirofox
jobs:
publish-to-amo:
name: Build and publish the extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm install --global web-ext
- id: version
run: echo OPHIROFOX_VERSION=$(jq -r ".version + \".$(($(date +%s)/65535)).$(($(date +%s)%65535))\"" < manifest.json) >> $GITHUB_ENV
- run: jq ".version |= \"$OPHIROFOX_VERSION\"" < manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json
- run: web-ext lint --self-hosted --warnings-as-errors
- run: web-ext build
- run: web-ext sign --channel=unlisted
env:
WEB_EXT_API_KEY: ${{ secrets.AMO_JWT_ISSUER }}
WEB_EXT_API_SECRET: ${{ secrets.AMO_JWT_SECRET }}
- run: ls -lah ./web-ext-artifacts
- run: cp $PWD/web-ext-artifacts/*xpi ../ophirofox.xpi
- name: Create the mobile version (with all permissions asked on installation and no optional permissions)
run: |
jq '.permissions += .optional_permissions | .optional_permissions = []' manifest.json > manifest.mobile.json
mv manifest.mobile.json manifest.json
web-ext build --overwrite-dest
cp $PWD/web-ext-artifacts/*zip ../ophirofox.mobile.zip
- run: node ../update-manifest.js | tee /tmp/update_manifest.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: git log -1 --pretty=%B | tee /tmp/changelog.txt
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.OPHIROFOX_VERSION }}
name: Release ${{ env.OPHIROFOX_VERSION }}
draft: false
prerelease: false
files: |
ophirofox.xpi
ophirofox.mobile.zip
/tmp/update_manifest.json
/tmp/changelog.txt