Skip to content

Manual Publish

Manual Publish #9

Workflow file for this run

name: Manual Publish
run-name: Manual Publish${{ 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: 'no'
options:
- 'yes'
- 'no'
jobs:
release:
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: πŸ‘· Checkout
uses: actions/checkout@v4
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 }}
run: |
if [[ "${RELEASE_TYPE}" == "pre"* ]]; then
VERSION="$(node .github/scripts/genPreReleaseVersion.js)"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
else
echo "version=" >> $GITHUB_OUTPUT
fi
- name: 🚧 Bump the version
id: bump
run: |
pnpm lerna version ${{github.event.inputs.releaseType}} --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.version }}
- 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.version }}
- 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.GITHUB_TOKEN }}
VSCODE_WDIO_DRY_RUN: ${{ github.event.inputs.dryRun }}
VSCODE_WDIO_RELEASE_NOTE: ${{ steps.bump.outputs.changelog }}