Skip to content

GitHub CI - Publish to NPM #949

GitHub CI - Publish to NPM

GitHub CI - Publish to NPM #949

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: GitHub CI - Publish to NPM
on:
workflow_dispatch:
release:
types:
- released
env:
access: public
alias: leanup
registry: https://registry.npmjs.org
tag: latest
token: ${{ secrets.NPMJS_AUTH_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '14.x'
registry-url: '${{env.registry}}'
scope: '@${{env.alias}}'
- name: Install and publish only @${{env.alias}}/stack
run: |
npm install
npm publish --access=${{env.access}} --tag=${{env.tag}} || true
working-directory: packages/stack/core
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Install and publish only @${{env.alias}}/stack-snowpack
run: |
npm install
npm publish --access=${{env.access}} --tag=${{env.tag}} || true
working-directory: packages/stack/snowpack
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Install and publish only @${{env.alias}}/stack-vite
run: |
npm install
npm publish --access=${{env.access}} --tag=${{env.tag}} || true
working-directory: packages/stack/vite
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Install and publish only @${{env.alias}}/stack-webpack
run: |
npm install
npm publish --access=${{env.access}} --tag=${{env.tag}} || true
working-directory: packages/stack/webpack
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Install and publish only @${{env.alias}}/lib
run: |
npm install
npm publish --access=${{env.access}} --tag=${{env.tag}} || true
working-directory: packages/lib
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Install and publish only @${{env.alias}}/cli-core-babel
run: |
npm install
npm publish --access=${{env.access}} --tag=${{env.tag}} || true
working-directory: packages/cli/core/babel
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Install and publish only @${{env.alias}}/cli
run: |
npm install
npm publish --access=${{env.access}} --access=public --tag=${{env.tag}} || true
working-directory: packages/cli/core
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Install and publish non @${{env.alias}}/cli, @${{env.alias}}/cli-core-babel, @${{env.alias}}/lib, @${{env.alias}}/stack, @${{env.alias}}/stack-snowpack, @${{env.alias}}/stack-vite and @${{env.alias}}/stack-webpack
run: |
rm -rf packages/stack/core/dist packages/stack/webpack/dist
npx lerna exec --ignore @template/* --ignore @${{env.alias}}/cli --ignore @${{env.alias}}/cli-core-babel --ignore @${{env.alias}}/lib --ignore @${{env.alias}}/stack --ignore @${{env.alias}}/stack-snowpack --ignore @${{env.alias}}/stack-vite --ignore @${{env.alias}}/stack-webpack --stream -- npm install
npx lerna exec --ignore @template/* --ignore @${{env.alias}}/cli --ignore @${{env.alias}}/cli-core-babel --ignore @${{env.alias}}/lib --ignore @${{env.alias}}/stack --ignore @${{env.alias}}/stack-snowpack --ignore @${{env.alias}}/stack-vite --ignore @${{env.alias}}/stack-webpack --no-bail --stream -- npm publish --access=${{env.access}} --tag=${{env.tag}} || true
env:
NODE_AUTH_TOKEN: ${{env.token}}
- name: Test all framework variants
run: |
rm ../.eslintrc.js
sh wake-up-all.sh ${{env.alias}} ${{env.tag}}
working-directory: scripts
env:
NODE_AUTH_TOKEN: ${{env.token}}