Publish to NPM #276
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 to NPM | |
on: | |
workflow_dispatch: | |
inputs: | |
major: | |
description: "Major" | |
type: boolean | |
default: false | |
minor: | |
description: "Minor" | |
type: boolean | |
default: false | |
jobs: | |
publish_job: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Checkout Rive Renderer Repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
repository: rive-app/rive-renderer | |
token: ${{ secrets.PAT_GITHUB }} | |
path: ./wasm/submodules/rive-renderer | |
ref: main | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v11 | |
with: | |
version: 3.1.43 | |
actions-cache-folder: "emsdk-cache" | |
- name: Setup Git config | |
run: | | |
git config --local user.email '[email protected]' | |
git config --local user.name ${{ github.actor }} | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Configure venv | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: Install premake | |
run: | | |
wget -q https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz | |
tar -xf premake-5.0.0-beta2-linux.tar.gz | |
sudo chmod a+x premake5 | |
sudo mv premake5 /usr/local/bin | |
pip3 install ply | |
- name: Install modules | |
run: cd js && npm install | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- if: ${{ inputs.major == true }} | |
name: Major Release - Bump version number, update changelog, push and tag | |
run: npm run release:major | |
working-directory: ./js | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} | |
PAT_GITHUB: ${{ secrets.PAT_GITHUB }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- if: ${{inputs.major == false && inputs.minor == true}} | |
name: Minor release - Bump version number, update changelog, push and tag | |
run: npm run release:minor | |
working-directory: ./js | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} | |
PAT_GITHUB: ${{ secrets.PAT_GITHUB }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- if: ${{inputs.major == false && inputs.minor == false}} | |
name: Patch release - Bump version number, update changelog, push and tag | |
run: npm run release:patch | |
working-directory: ./js | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} | |
PAT_GITHUB: ${{ secrets.PAT_GITHUB }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |