-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (49 loc) · 1.44 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Publish
# TODO change this trigger later
on:
pull_request:
branches:
- main
env:
NPM_TOKEN: ${{ secrets.CLPLAYERS_NPM_TOKEN_RW }}
# VERSION: ${{ github.event.release.tag_name }}
VERSION: 0.7.7
jobs:
publish-to-npm:
name: Publish to NPM
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Write NPM RC
run: |
echo '@castlabs:registry=https://registry.npmjs.org' > .npmrc
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
- name: Overwrite package.json Version
uses: castlabs/ref-to-version-action@main
with:
versionFile: package.json
from-tag: ${{ env.VERSION }}
# TODO remove this debug
- name: Debug Echo Version
run: echo ${{ env.VERSION }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
# TODO NOT dry run
- name: Publish to NPM
run: npm publish --dry-run
- name: Job Summary
run: |
echo '### NPM Release' >> $GITHUB_STEP_SUMMARY
echo "Released \`@castlabs/prestoplay-react-components@${{ env.VERSION }}\` to NPM" >> $GITHUB_STEP_SUMMARY
# publish_api_docs:
# name: Publish API Docs
# runs-on: [ubuntu-latest]
# steps: