diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c159b2a..cac6935 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,11 +31,10 @@ jobs: - name: Set Release Version run: | RELEASE_VERSION=${GITHUB_REF#refs/tags/v} - re=[0-9]+\.[0-9]+\.[0-9]+ - if [[ $RELEASE_VERSION =~ $re ]]; then - echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + if [[ $RELEASE_VERSION =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|alpha|rc))(\.[0-9][0-9]*)?$ ]]; then + echo "PACKAGE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV else - echo "Tag does not match expected semver regex pattern (v$re)" + echo 'Tag does not match expected semver regex pattern (^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|alpha|rc))(\.[0-9][0-9]*)?$)' echo $RELEASE_VERSION echo 'Please update your tag to match the expected regex pattern' exit 1 @@ -51,12 +50,12 @@ jobs: - name: Install Packages and Test run: | - yarn - yarn test + npm i + npm test - name: Publish npm Package run: | - npm version $RELEASE_VERSION --no-git-tag-version + npm version $PACKAGE_VERSION --no-git-tag-version npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}