This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
77 lines (76 loc) · 2.37 KB
/
publish.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
name: Extension Publisher
on:
workflow_dispatch:
env:
NODE_VERSION: 19.x
jobs:
create-tag:
runs-on: ubuntu-latest
outputs:
new-tag: v${{ steps.versioning.outputs.new-tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git setup
run: |
git --version
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Version upgrade
id: versioning
run: |
NEW_TAG=$(node ./utils/version-upgrader.js PATCH)
# Data saved for next steps
echo "new-tag=$NEW_TAG" >> $GITHUB_OUTPUT
- name: Commit and Push
run: |
git commit -am "v${{ steps.versioning.outputs.new-tag }}" -m "[skip ci]"
git tag -a "v${{ steps.versioning.outputs.new-tag }}" -m "v${{ steps.versioning.outputs.new-tag }}"
git push origin HEAD "v${{ steps.versioning.outputs.new-tag }}"
build:
runs-on: ubuntu-latest
needs: create-tag
steps:
- uses: actions/[email protected]
- name: Node.js Setup
uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- name: Dependencies set-up
run: |
npm install --global yarn
yarn install
- name: MV3 extension build
run: yarn build --outDir ./dist/mv3
- name: MV2 extension build
run: yarn build2 --outDir ./dist/mv2
- name: Zip artifacts
run: |
(cd ./dist/mv2/ zip -r ../../extension-firefox.xpi ./*)
(cd ./dist/mv3/ zip -r ../../extension.zip ./*)
- name: Upload artifacts
uses: actions/[email protected]
with:
name: artifacts.zip
path: |
./extension.zip
./extension-firefox.xpi
if-no-files-found: error
release:
runs-on: ubuntu-latest
needs:
- build
- create-tag
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/[email protected]
with:
name: artifacts.zip
path: ./dist/
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ needs.create-tag.outputs.new-tag }} --verify-tag -d --generate-notes ./dist/*