-
-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (100 loc) · 3.54 KB
/
release.yml
File metadata and controls
110 lines (100 loc) · 3.54 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Manual Publish
run-name: Manual Publish - ${{ github.event.inputs.releaseType }}${{ github.event.inputs.dryRun == 'yes' && ' (DRY RUN)' || '' }}
on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release Type'
required: true
type: choice
default: 'patch'
options:
- patch
- minor
- major
- prepatch
- preminor
- premajor
- prerelease
publishMarketplace:
description: 'Publish on Visual Studio Marketplace?'
required: true
type: choice
default: 'yes'
options:
- 'yes'
- 'no'
dryRun:
description: 'Dry run? If yes, this workflow will NOT push to remote and NOT publish the extension.'
required: true
type: choice
default: 'yes'
options:
- 'yes'
- 'no'
env:
TURBO_TELEMETRY_DISABLED: 1
jobs:
release:
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: 👷 Checkout
uses: actions/[email protected]
with:
ref: 'main'
fetch-depth: 0
- name: 🛠️ Setup workspace
uses: ./.github/workflows/actions/setup-workspace
with:
node-version: '20'
- name: 🪄 Generate Prerelease patch version number
id: gen-pre-release-ver
env:
RELEASE_TYPE: ${{ github.event.inputs.releaseType }}
uses: actions/[email protected]
with:
result-encoding: string
script: |
const releaseType = process.env.RELEASE_TYPE;
const isPreRelease = releaseType.startsWith('pre')
const version = isPreRelease ? String(Math.floor(Date.now() / 1000)) : '';
if (isPreRelease) {
core.info(`Pre-release patch version number: ${version}`)
} else {
core.info(`This is not pre-release: ${version}`)
}
return version
- name: 🚧 Bump the version
id: bump
run: |
pnpm lerna version ${{github.event.inputs.releaseType}} --force-publish --no-push --exact --preid next --yes -m "chore(release): %s"
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
VSCODE_WDIO_PRE_RELEASE_PATCH_NUMBER: ${{ steps.gen-pre-release-ver.outputs.result }}
- name: 🛫 Build and publish as pre-release
if: ${{ github.event.inputs.publishMarketplace == 'yes' && startsWith(github.event.inputs.releaseType, 'pre') }}
run: |
pnpm run publish:next
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
VSCODE_WDIO_DRY_RUN: ${{ github.event.inputs.dryRun }}
VSCODE_WDIO_PRE_RELEASE_PATCH_NUMBER: ${{ steps.gen-pre-release-ver.outputs.result }}
- name: 🚀 Build and publish
if: ${{ github.event.inputs.publishMarketplace == 'yes' && !startsWith(github.event.inputs.releaseType, 'pre') }}
run: |
pnpm run publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
VSCODE_WDIO_DRY_RUN: ${{ github.event.inputs.dryRun }}
- name: 📝 Create the Github Release
run: |
pnpm --filter @vscode-wdio/release run release-note
env:
GITHUB_AUTH: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }}
VSCODE_WDIO_DRY_RUN: ${{ github.event.inputs.dryRun }}
VSCODE_WDIO_RELEASE_NOTE: ${{ steps.bump.outputs.changelog }}