Skip to content

Commit f2d9e32

Browse files
authored
ci: add release workflow
1 parent cf6888c commit f2d9e32

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/npm_release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: '@nativescript/doctor -> npm'
2+
3+
on:
4+
push:
5+
branches: [ 'master' ]
6+
7+
env:
8+
NPM_TAG: 'next'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Setup
18+
run: npm install
19+
20+
- name: Generate Version
21+
run: |
22+
echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);")-$NPM_TAG-$(date +"%m-%d-%Y")-$GITHUB_RUN_ID >> $GITHUB_ENV
23+
24+
- name: Bump Version
25+
run: npm version $NPM_VERSION
26+
27+
- name: Build @nativescript/doctor
28+
run: npm run pack
29+
30+
- name: Publish @nativescript/core
31+
working-directory: dist/packages
32+
env:
33+
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
34+
run: |
35+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../../.npmrc
36+
echo "Publishing @nativescript/doctor@$NPM_VERSION to NPM with tag $NPM_TAG..."
37+
npm publish nativescript-doctor-$NPM_VERSION.tgz --tag $NPM_TAG

0 commit comments

Comments
 (0)