Skip to content

Commit 54de9fb

Browse files
committed
chore: update release workflow
[skip ci]
1 parent e096e79 commit 54de9fb

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

.github/scripts/genPreReleaseVersion.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/release.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Manual Publish
22

3-
run-name: Manual Publish${{ github.event.inputs.dryRun == 'yes' && ' (DRY RUN)' || '' }}
3+
run-name: Manual Publish - ${{ github.event.inputs.releaseType }}${{ github.event.inputs.dryRun == 'yes' && ' (DRY RUN)' || '' }}
44

55
on:
66
workflow_dispatch:
@@ -35,6 +35,9 @@ on:
3535
- 'yes'
3636
- 'no'
3737

38+
env:
39+
TURBO_TELEMETRY_DISABLED: 1
40+
3841
jobs:
3942
release:
4043
permissions:
@@ -57,21 +60,27 @@ jobs:
5760
id: gen-pre-release-ver
5861
env:
5962
RELEASE_TYPE: ${{ github.event.inputs.releaseType }}
60-
run: |
61-
if [[ "${RELEASE_TYPE}" == "pre"* ]]; then
62-
VERSION="$(node .github/scripts/genPreReleaseVersion.js)"
63-
echo "version=${VERSION}" >> $GITHUB_OUTPUT
64-
else
65-
echo "version=" >> $GITHUB_OUTPUT
66-
fi
63+
uses: actions/[email protected]
64+
with:
65+
result-encoding: string
66+
script: |
67+
const releaseType = process.env.RELEASE_TYPE;
68+
const isPreRelease = title.startsWith('pre')
69+
const version = isPreRelease ? String(Math.floor(Date.now() / 1000)) : '';
70+
if (isPreRelease) {
71+
core.info(`Pre-release patch version number: ${version}`)
72+
} else {
73+
core.info(`This is not pre-release: ${version}`)
74+
}
75+
return version
6776
6877
- name: 🚧 Bump the version
6978
id: bump
7079
run: |
7180
pnpm lerna version ${{github.event.inputs.releaseType}} --no-push --exact --preid next --yes -m "chore(release): %s"
7281
env:
7382
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
74-
VSCODE_WDIO_PRE_RELEASE_PATCH_NUMBER: ${{ steps.gen-pre-release-ver.outputs.version }}
83+
VSCODE_WDIO_PRE_RELEASE_PATCH_NUMBER: ${{ steps.gen-pre-release-ver.outputs.result }}
7584

7685
- name: 🛫 Build and publish as pre-release
7786
if: ${{ github.event.inputs.publishMarketplace == 'yes' && startsWith(github.event.inputs.releaseType, 'pre') }}
@@ -81,7 +90,7 @@ jobs:
8190
VSCE_PAT: ${{ secrets.VSCE_PAT }}
8291
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
8392
VSCODE_WDIO_DRY_RUN: ${{ github.event.inputs.dryRun }}
84-
VSCODE_WDIO_PRE_RELEASE_PATCH_NUMBER: ${{ steps.gen-pre-release-ver.outputs.version }}
93+
VSCODE_WDIO_PRE_RELEASE_PATCH_NUMBER: ${{ steps.gen-pre-release-ver.outputs.result }}
8594

8695
- name: 🚀 Build and publish
8796
if: ${{ github.event.inputs.publishMarketplace == 'yes' && !startsWith(github.event.inputs.releaseType, 'pre') }}
@@ -96,6 +105,6 @@ jobs:
96105
run: |
97106
pnpm --filter @vscode-wdio/release run release-note
98107
env:
99-
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
108+
GITHUB_AUTH: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }}
100109
VSCODE_WDIO_DRY_RUN: ${{ github.event.inputs.dryRun }}
101110
VSCODE_WDIO_RELEASE_NOTE: ${{ steps.bump.outputs.changelog }}

0 commit comments

Comments
 (0)