Skip to content

Commit df48900

Browse files
committed
For staging, autoupdate version
1 parent 75d61c4 commit df48900

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/submit.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
inputs:
55
channel:
6-
description: 'Release channel to publish to'
6+
description: "Release channel to publish to"
77
required: true
88
type: choice
99
options:
@@ -35,12 +35,21 @@ jobs:
3535
with:
3636
node-version: 18.x
3737
cache: "pnpm"
38+
- name: Change version (Staging)
39+
if: env.CHANNEL == 'staging'
40+
run: |
41+
DATE=$(date +'%Y.%m.%d')
42+
BASE_VERSION=$(jq -r .version package.json | cut -d'-' -f1)
43+
44+
NEW_VERSION="${BASE_VERSION}-${DATE}"
45+
jq --arg version "$NEW_VERSION" '.version = $version' package.json > package_tmp.json && mv package_tmp.json package.json
46+
3847
- name: Build the extension (Chrome)
3948
run: pnpm plasmo build --target=chrome-mv3
4049
- name: Build the extension (Firefox)
4150
run: pnpm plasmo build --target=firefox-mv2
4251
- name: Package the extension into zip artifacts
43-
run: |
52+
run: |
4453
pnpm package --target=chrome-mv3
4554
pnpm package --target=firefox-mv2
4655
- name: Browser Platform Publish (staging)

0 commit comments

Comments
 (0)