-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.17 KB
/
publish.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
name: Publish to NPM
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.com/
scope: '@relewise'
- name: Calculate environment variables
run: |
echo "TAG_NAME=$(github.event.tag_name)"
echo "PACKAGE_PATH=$(github.event.tag_name.split('@')[0])" >> $GITHUB_ENV
echo "VERSION=$(github.event.tag_name.split('@')[1])" >> $GITHUB_ENV
- uses: brettdorrans/write-version-to-file@master
if: ${{ PACKAGE_PATH == 'client' }}
name: Update version
working-directory: ./packages/${ PACKAGE_PATH }
with:
filename: './src/version.ts'
placeholder: '${VERSION}'
- run: npm ci
working-directory: ./packages/${ PACKAGE_PATH }
- run: npm run publish
working-directory: ./packages/${ PACKAGE_PATH }
- run: npm publish --access public
working-directory: ./packages/${ PACKAGE_PATH }
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}