-
-
Notifications
You must be signed in to change notification settings - Fork 76
73 lines (71 loc) · 2.31 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
env:
DIRECTORY: distribution
PROJECT_NAME: extension
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/webext
# SOURCE: https://github.com/fregante/ghatemplates
name: Release
on:
workflow_dispatch: null
jobs:
Version:
outputs:
created: ${{ env.DAILY_VERSION_CREATED }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- name: Test and build
run: npm test
- name: Create tag if necessary
uses: fregante/daily-version-action@v2
- name: Update manifest.json with version ${{ env.DAILY_VERSION}}
if: env.DAILY_VERSION_CREATED
run: npx dot-json@1 "$DIRECTORY/manifest.json" version "$DAILY_VERSION"
- name: Ready for "submit" jobs
if: env.DAILY_VERSION_CREATED
uses: actions/upload-artifact@v3
with:
path: ${{ env.DIRECTORY }}
- name: Create release
if: env.DAILY_VERSION_CREATED
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ env.DIRECTORY }}
run: |
FILENAME="$PROJECT_NAME-$DAILY_VERSION-for-local-testing-only.zip"
zip -r "$FILENAME" ./*
gh release create "$DAILY_VERSION" --generate-notes "$FILENAME"
Chrome:
if: needs.Version.outputs.created
needs: Version
name: Submit (Chrome)
environment: Chrome
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- run: npx chrome-webstore-upload-cli@3 upload --auto-publish
working-directory: artifact
env:
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
Firefox:
if: needs.Version.outputs.created
needs: Version
name: Submit (Firefox)
environment: Firefox
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- run: npx web-ext@7 sign --use-submission-api --channel listed
working-directory: artifact
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}