Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Publish

Publish #33

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
versionClass:
type: choice
required: true
options:
- 'patch'
- 'minor'
- 'major'
schedule:
- cron: '0 0 20 * *' # at AM 9 JST on day of month 20
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version-file: '.node-version'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Bump version and publish
id: bump-version
run: |
git config user.name '[bot] github action (${{ github.workflow }})'
git config user.email '[email protected]'
yarn version --${{ github.event_name == 'schedule' && 'patch' || github.event.inputs.versionClass }}
echo "new_version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create release
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.repos.createRelease({
owner: "${{github.repository_owner}}",
repo: "${{github.repository}}".split('/')[1],
tag_name: "v${{ steps.bump-version.outputs.new_version }}",
generate_release_notes: true,
})