ci: add workflows for different packages

This commit is contained in:
Igor Randjelovic
2020-12-28 14:37:01 +01:00
parent 875dc138a8
commit 69b7fc377a
3 changed files with 86 additions and 0 deletions

42
.github/workflows/npm_release_core.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: '@nativescript/core -> npm'
on:
push:
branches: [ 'master' ]
paths:
- 'packages/core/*'
env:
NPM_TAG: 'next'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup
run: npm install
- name: Generate Version
working-directory: packages/core
run: |
echo NPM_VERSION=$(node -e "console.log(require('./package.json').version);")-$NPM_TAG-$(date +"%m-%d-%Y")-$GITHUB_RUN_ID >> $GITHUB_ENV
- name: Bump Version
working-directory: packages/core
run: npm version $NPM_VERSION
# TODO: build ui-mobile-base first
- name: Build @nativescript/core
run: npx nx run core:build
- name: Publish @nativescript/core
working-directory: dist/packages
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../../.npmrc
echo "Publishing @nativescript/core@$NPM_VERSION to NPM with tag $NPM_TAG..."
npm publish nativescript-core-$NPM_VERSION.tgz --tag $NPM_TAG