-
-
Notifications
You must be signed in to change notification settings - Fork 163
48 lines (44 loc) · 1.57 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
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 version=$(jq -r ".version + \".$(($(date +%s)/100000)).$(($(date +%s)%65535))\"" < manifest.json) >> $GITHUB_OUTPUT
- run: jq ".version |= \"$VERSION\"" < manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json
env:
VERSION: ${{ steps.version.outputs.version }}
- 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
- run: ../update-manifest.py | tee /tmp/update_manifest.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.version.outputs.version }}
name: Release ${{ steps.version.outputs.version }}
draft: false
prerelease: false
files: |
ophirofox.xpi
/tmp/update_manifest.json