diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml new file mode 100644 index 00000000..e9662ce6 --- /dev/null +++ b/.github/workflows/release-alpha.yml @@ -0,0 +1,34 @@ +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 + +permissions: + id-token: write + +name: release-alpha + +jobs: + release-alpha: + runs-on: ubuntu-latest + steps: + - shell: bash + run: | + ALPHA_SEMVER_REGEXP="-alpha(\.([0-9]|[1-9][0-9]+))?$" + + if ! [[ "${{ inputs.alphaVersion }}" =~ $ALPHA_SEMVER_REGEXP ]]; then + echo "Invalid alphaVersion string" + exit 1 + fi + - uses: actions/checkout@v3 + - name: actions/setup + uses: ./.github/actions/setup + - run: npm version "${{ inputs.alphaVersion }}" --git-tag-version=false + - run: npm publish --provenance --tag=alpha + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}