From 69b7fc377a562dd241808174587254054e8aa6bb Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Mon, 28 Dec 2020 14:37:01 +0100 Subject: [PATCH] ci: add workflows for different packages --- .../{npm_release.yml => npm_release_core.yml} | 3 ++ .github/workflows/npm_release_types.yml | 42 +++++++++++++++++++ .github/workflows/npm_release_webpack.yml | 41 ++++++++++++++++++ 3 files changed, 86 insertions(+) rename .github/workflows/{npm_release.yml => npm_release_core.yml} (93%) create mode 100644 .github/workflows/npm_release_types.yml create mode 100644 .github/workflows/npm_release_webpack.yml diff --git a/.github/workflows/npm_release.yml b/.github/workflows/npm_release_core.yml similarity index 93% rename from .github/workflows/npm_release.yml rename to .github/workflows/npm_release_core.yml index 1e479ab7e..821f5dd1f 100644 --- a/.github/workflows/npm_release.yml +++ b/.github/workflows/npm_release_core.yml @@ -3,6 +3,8 @@ name: '@nativescript/core -> npm' on: push: branches: [ 'master' ] + paths: + - 'packages/core/*' env: NPM_TAG: 'next' @@ -26,6 +28,7 @@ jobs: 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 diff --git a/.github/workflows/npm_release_types.yml b/.github/workflows/npm_release_types.yml new file mode 100644 index 000000000..dd815dc0b --- /dev/null +++ b/.github/workflows/npm_release_types.yml @@ -0,0 +1,42 @@ +# TODO: modify to build android & ios types first and then merge into types +#name: '@nativescript/types -> npm' +# +#on: +# push: +# branches: [ 'master' ] +# paths: +# - 'packages/types/*' +# +#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/types +# 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/types +# run: npm version $NPM_VERSION +# +# - name: Build @nativescript/types +# run: npx nx run core:build +# +# - name: Publish @nativescript/types +# working-directory: dist/packages +# env: +# NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} +# run: | +# echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../../.npmrc +# echo "Publishing @nativescript/types@$NPM_VERSION to NPM with tag $NPM_TAG..." +# npm publish nativescript-types-$NPM_VERSION.tgz --tag $NPM_TAG diff --git a/.github/workflows/npm_release_webpack.yml b/.github/workflows/npm_release_webpack.yml new file mode 100644 index 000000000..c4f2affa0 --- /dev/null +++ b/.github/workflows/npm_release_webpack.yml @@ -0,0 +1,41 @@ +name: '@nativescript/webpack -> npm' + +on: + push: + branches: [ 'master' ] + paths: + - 'packages/webpack/*' + +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/webpack + 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/webpack + run: npm version $NPM_VERSION + + - name: Build @nativescript/webpack + run: npx nx run webpack:build + + - name: Publish @nativescript/webpack + working-directory: dist/packages + env: + NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ../../.npmrc + echo "Publishing @nativescript/webpack@$NPM_VERSION to NPM with tag $NPM_TAG..." + npm publish nativescript-webpack.tgz --tag $NPM_TAG --dry-run