Skip to content

Publish to NPM

Publish to NPM #273

Workflow file for this run

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 'hello@rive.app'
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 }}