-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.28 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
name: NPM Publish
on:
push:
tags:
- '*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set version from tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: print version number
run: echo ${{ env.RELEASE_VERSION }}
- uses: actions/setup-node@v3
with:
node-version: 18
- name: configure git
run: |
git config user.email "[email protected]"
git config user.name "Plattar"
- name: set pre-release version
run: npm version --prefix sdk-core ${{ env.RELEASE_VERSION }}
- name: write version.js
run: rm -rf sdk-core/src/version.ts && echo 'export default "${{ env.RELEASE_VERSION }}";' > sdk-core/src/version.ts
- name: copy README
run: cp README.md sdk-core/README.md
- name: copy graphics
run: cp -R graphics sdk-core/
- name: NPM Login & Build
run: rm -rf sdk-core/.npmrc && npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_PUBLISH_KEY }} && npm run --prefix sdk-core clean:build
- uses: JS-DevTools/npm-publish@v1
with:
package: ./sdk-core/package.json
token: ${{ secrets.NPM_PUBLISH_KEY }}
access: 'public'