From 06f177454c35b5b1b44d4c78b33886ab340b80a7 Mon Sep 17 00:00:00 2001 From: Warren James Date: Thu, 24 Aug 2023 14:47:04 -0400 Subject: [PATCH] chore(NODE-5580): add release alpha action (#616) --- .github/workflows/release-alpha.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release-alpha.yml 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 }}