Manual Publish #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |