Skip to content

Manual Publish - patch #19

Manual Publish - patch

Manual Publish - patch #19

Workflow file for this run

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 }}