Skip to content

Release

Release #9

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Publish
on:
workflow_dispatch:
inputs:
version:
description: Release type
required: false
type: choice
default: patch
options:
- patch
- minor
- major
release:
types: [created]
jobs:
build:
uses: ./.github/workflows/build.yml
version:
needs: build
runs-on: ubuntu-latest
name: Update version in package.json
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Show version
run: cat ./package.json | grep version
- name: Bump version
id: version
uses: KageKirin/[email protected]
with:
major: ${{ github.event.inputs.version == 'major' }}
minor: ${{ github.event.inputs.version == 'minor' }}
patch: ${{ github.event.inputs.version == 'patch' }}
- name: Show updated version
run: cat ./package.json | grep version
- name: Commit new version
run: |
echo ${{ toJson(steps.version) }}
# publish-npm:
# needs: version
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
# registry-url: https://registry.npmjs.org/
# - run: npm ci
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}