-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.24 KB
/
deploy-beta.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Deploy Beta
on:
release:
types: [published]
jobs:
deploy_beta:
name: Deploy Beta
runs-on: ubuntu-latest
if: ${{ github.event.release.prerelease }}
steps:
- name: Set Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Check Release Version Format
run: |
re=[0-9]+.[0-9]+.[0-9]+-beta
if ! [[ $RELEASE_VERSION =~ $re ]]; then
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+-beta)'
echo $RELEASE_VERSION
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
registry-url: 'https://registry.npmjs.org'
- name: Build and Test npm Package
run: |
npm install
npm run build
npm run test
- name: Publish npm Package
run: |
npm version $RELEASE_VERSION --no-git-tag-version
npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}