Update README.md #4
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: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version bump type' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install | |
- name: Run linter | |
run: bun run lint | |
- name: Run TypeScript check | |
run: bun run lint:ts | |
- name: Run tests | |
run: bun run test:run | |
- name: Build library | |
run: bun run build | |
- name: Get current version | |
id: get-version | |
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Publish to npm | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create Git Tag | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git tag -a "v${{ steps.get-version.outputs.version }}" -m "Release v${{ steps.get-version.outputs.version }}" | |
git push origin "v${{ steps.get-version.outputs.version }}" | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.get-version.outputs.version }} | |
release_name: Release v${{ steps.get-version.outputs.version }} | |
body: | | |
## 🚀 Release v${{ steps.get-version.outputs.version }} | |
Published to npm: [@flowscape-ui/core-sdk@${{ steps.get-version.outputs.version }}](https://www.npmjs.com/package/@flowscape-ui/core-sdk/v/${{ steps.get-version.outputs.version }}) | |
### Changes | |
See [CHANGELOG.md](./CHANGELOG.md) for details. | |
draft: false | |
prerelease: false |