name: Manual Publish Package to npmjs
on:
  workflow_call:
    inputs:
      version:
        type: string
        required: true
        description: 'The version to publish. Must be a valid semver version.'
jobs:
  manual-release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 'lts/*'
      - run: npm ci
      - run: sed -i 's/0.0.0-development/${{ inputs.version }}/' ./package.json
      - run: npm publish --access public --tag beta
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
