Merge pull request #8 from OpsMx/OES-1.33.x-mergebranch #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish packages to NPM | |
on: | |
push: | |
branches: | |
- 'OES-1.33.x' | |
paths: | |
- 'packages/*/package.json' | |
env: | |
NODE_VERSION: 14.21.3 | |
permissions: | |
contents: read | |
jobs: | |
publish: | |
permissions: | |
contents: none | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: '${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: git - tag bumped packages | |
id: tag | |
run: | | |
git config user.name spinnakerbot | |
git config user.email [email protected] | |
scripts/gha_tag_bumped_packages.sh | |
- name: yarn | |
if: ${{ steps.tag.outputs.tagged == 'true' }} | |
run: yarn --frozen-lockfile | |
- name: build all packages | |
if: ${{ steps.tag.outputs.tagged == 'true' }} | |
run: npx lerna run build | |
env: | |
NODE_ENV: production | |
- name: publish packages to npm | |
if: ${{ steps.tag.outputs.tagged == 'true' }} | |
run: | | |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN | |
# Publish all changed packages, but do not build a second time | |
npx lerna publish from-git --yes --ignore-scripts | |
env: | |
CI: true | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |