-
Notifications
You must be signed in to change notification settings - Fork 211
33 lines (27 loc) · 1008 Bytes
/
npm.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
name: "Build and Publish NPM package"
on:
release:
types: [published]
jobs:
build_and_publish:
name: "Publish ccf-app package to NPM"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Get release number from git tag (release) or latest (branch)
run: |
echo "version=${GITHUB_REF#refs/tags/ccf-}" >> $GITHUB_OUTPUT
id: tref
- name: Fetch NPM Package from release
run: |
cd js/ccf-app
wget https://github.com/microsoft/CCF/releases/download/ccf-${{steps.tref.outputs.version}}/microsoft-ccf-app-${{steps.tref.outputs.version}}.tgz
- name: Publish NPM Package to https://www.npmjs.com/package/@microsoft/ccf-app
run: |
set -ex
cd js/ccf-app
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm publish microsoft-ccf-app*.tgz --access public