Publish to NPM #333
This file contains hidden or 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@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| token: ${{ secrets.PAT_GITHUB }} | |
| - name: Checkout Rive Renderer Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| repository: rive-app/rive-renderer | |
| token: ${{ secrets.PAT_GITHUB }} | |
| path: ./wasm/submodules/rive-renderer | |
| ref: main | |
| - 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 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: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| PAT_GITHUB: ${{ secrets.PAT_GITHUB }} | |
| - 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: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| PAT_GITHUB: ${{ secrets.PAT_GITHUB }} | |
| - 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: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| PAT_GITHUB: ${{ secrets.PAT_GITHUB }} |