-
Notifications
You must be signed in to change notification settings - Fork 10
59 lines (54 loc) · 1.73 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
47
48
49
50
51
52
53
54
55
56
57
58
59
---
#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#
#######################################
# Start the job on all push to master #
#######################################
name: 'Build & Deploy - Beta'
on:
push:
branches:
- master
permissions: write-all
concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true
###############
# Set the Job #
###############
jobs:
# Deploy to NPM
deploy_to_npm:
name: Deploy to NPM (beta)
runs-on: ubuntu-latest
permissions: read-all
environment:
name: beta
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
scope: rubenhalman
- run: npm ci
- run: |
git config --global user.name ${{ vars.USER_NAME }}
git config --global user.email ${{ vars.USER_EMAIL }}
- run: npm i -D semver node-jq
- run: |
export original_npm_package_version=$(npx node-jq ".version" package.json)
echo $original_npm_package_version
export npm_package_version=$(npx semver $original_npm_package_version --increment patch --coerce)
echo $npm_package_version
- run: npx node-jq --arg version "$npm_package_version" '.version=$version' package.json > package2.json && rm package.json && mv package2.json package.json
- run: |
git commit -am "ci: update package json to $npm_package_version [skip ci]" --no-verify
git push
- run: npm version $npm_package_version
shell: bash
- run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKENX }}