feat: demo cluster api (#550) #490
Workflow file for this run
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
# | |
# This CI triggered when a PR is merged in release/v12 branch. | |
# | |
# 1. Increase version number (e.g. 0.0.1 => 0.0.2) in package.json and add a git tag | |
# 2. Publish to npm registry | |
# | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
versioning: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://npm.pkg.github.com" | |
- run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Github Action Bot" | |
- name: '`npm version patch` if PR has no label "minor" or "major"' | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'minor') && !contains(github.event.pull_request.labels.*.name, 'major') }} | |
run: | | |
npm version patch | |
- name: '`npm version minor` if PR has label "minor"' | |
if: contains(github.event.pull_request.labels.*.name, 'minor') | |
run: | | |
npm version minor | |
- name: '`npm version major` if PR has label "major"' | |
if: contains(github.event.pull_request.labels.*.name, 'major') | |
run: | | |
npm version major | |
- name: Push versioning commit and tag | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: release/v12 | |
tags: true | |
publish: | |
needs: versioning | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://npm.pkg.github.com" | |
# need this if commit/push in other jobs (versioning) | |
- run: git pull | |
- run: npm install | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: npm run build:dist | |
- run: | | |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |