-
Notifications
You must be signed in to change notification settings - Fork 7
87 lines (74 loc) · 3.1 KB
/
Copy pathrelease.yml
File metadata and controls
87 lines (74 loc) · 3.1 KB
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:
push:
branches:
- main
jobs:
validate:
name: Validate
uses: ./.github/workflows/validate.yml
secrets: inherit
release:
name: Create Release
runs-on: ubuntu-22.04
needs: [validate]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
- name: Configure Git
run: |
git config user.email "github-actions@users.noreply.github.com"
git config user.name "GitHub Actions"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Bump Version
id: version
run: |
LAST_STABLE=$(git tag --list 'v*' --sort=-version:refname | grep -v beta | head -1)
bunx changelogen@latest --bump --from "$LAST_STABLE"
NEW_VERSION=$(bun --print 'require("./package.json").version')
echo "newVersion=$NEW_VERSION" >> "$GITHUB_OUTPUT"
- name: Build and Zip
run: |
bun run zip
bun run zip:fox
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: .output/*.zip
if-no-files-found: error
include-hidden-files: true
- name: Commit Version Bump
run: |
git add package.json CHANGELOG.md
git commit -am "chore(release): v${{ steps.version.outputs.newVersion }}"
git tag v${{ steps.version.outputs.newVersion }}
git push
git push --tags
- name: Create GitHub Release
run: npx changelogen@latest gh release ${{ steps.version.outputs.newVersion }} --token ${{ github.token }}
- name: Upload Release Assets
run: gh release upload v${{ steps.version.outputs.newVersion }} .output/*-chrome.zip .output/*-firefox.zip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Submit to Extension Stores
run: |
bun wxt submit \
--chrome-zip .output/*-chrome.zip \
--firefox-zip .output/*-firefox.zip --firefox-sources-zip .output/*-sources.zip
env:
CHROME_EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CHROME_CLIENT_ID: ${{ secrets.CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
FIREFOX_EXTENSION_ID: ${{ secrets.AMO_ID }}
FIREFOX_JWT_ISSUER: ${{ secrets.AMO_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.AMO_SECRET }}
- name: Sync main back to develop
run: |
git fetch origin develop
git checkout develop
git merge main --no-edit
git push origin develop