release-alpha #5
Workflow file for this run
This file contains 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
on: | |
# Allows us to manually trigger an alpha | |
# workflow_dispatch can be given an alternative 'ref' to release from a feature branch | |
workflow_dispatch: | |
inputs: | |
alphaVersion: | |
description: 'Enter alpha version' | |
required: true | |
type: string | |
wetRun: | |
description: 'run publish?' | |
required: true | |
type: boolean | |
name: release-alpha | |
jobs: | |
release-alpha: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- run: | | |
ALPHA_SEMVER_REGEXP="-alpha(\.(0|[1-9][0-9]+))?$" | |
if ! [[ "${{ inputs.alphaVersion }}" =~ $ALPHA_SEMVER_REGEXP ]]; then | |
echo "Invalid alphaVersion string" | |
exit 1 | |
fi | |
if ! [[ "${{ inputs.wetRun }}" =~ ^true|false$ ]]; then | |
echo "Invalid boolean" | |
exit 1 | |
fi | |
shell: bash | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 'lts/*' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install -g npm | |
- run: npm clean-install | |
- run: npm version "${{ inputs.alphaVersion }}" --git-tag-version=false | |
# TODO: remove hardcoded dry-run | |
- run: npm publish --dry-run=true --provenance --tag=alpha | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |