Skip to content

Publish to NPM

Publish to NPM #177

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: 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: Install premake
run: |
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha16/premake-5.0.0-alpha16-linux.tar.gz
tar -xvf premake-5.0.0-alpha16-linux.tar.gz
sudo chmod a+x premake5
sudo mv premake5 /usr/local/bin
- 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 }}