-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (79 loc) · 2.7 KB
/
submit.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
88
89
90
91
name: Submit for Review
on:
workflow_dispatch:
inputs:
dryRun:
default: false
type: boolean
description: Skip submission and perform a dry run
jobs:
validate:
name: Validate
uses: ./.github/workflows/validate.yml
secrets: inherit
submit:
name: Submit
runs-on: ubuntu-22.04
needs: [validate]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Configure Git
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Install dependencies
run: pnpm install
- name: Bump Version
id: version
run: |
pnpx changelogen@latest --bump
NEW_VERSION=$(node -pe 'require("./package.json").version')
echo "newVersion=$NEW_VERSION" >> "$GITHUB_OUTPUT"
- name: Build and Zip
run: |
pnpm zip
pnpm zip:firefox
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: .output/*.zip
if-no-files-found: error
- name: Submit
run: |
pnpm wxt submit \
--chrome-zip .output/*-chrome.zip \
--firefox-zip .output/*-firefox.zip --firefox-sources-zip .output/*-sources.zip
env:
DRY_RUN: ${{ inputs.dryRun }}
CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }}
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
EDGE_PRODUCT_ID: ${{ secrets.EDGE_PRODUCT_ID }}
EDGE_CLIENT_ID: ${{ secrets.EDGE_CLIENT_ID }}
EDGE_CLIENT_SECRET: ${{ secrets.EDGE_CLIENT_SECRET }}
EDGE_ACCESS_TOKEN_URL: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
- name: Commit and Push
if: ${{ !inputs.dryRun }}
run: |
git add package.json CHANGELOG.md
git commit -am "chore(release): v$NEW_VERSION"
git tag v$NEW_VERSION
git push
git push --tags
env:
NEW_VERSION: ${{ steps.version.outputs.newVersion }}
- name: Release
if: ${{ !inputs.dryRun }}
run: pnpx changelogen@latest gh release ${{ steps.version.outputs.newVersion }} --token ${{ github.token }}