Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 24 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,52 @@
name: Release Full
# This action will publish the package to npm and create a GitHub release.
name: Release

on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Release Version Type'
required: true
default: 'patch'
options:
- major
- premajor
- minor
- preminor
- patch
- prepatch
- prerelease

tag:
type: choice
description: 'Release Npm Tag'
required: true
default: 'latest'
options:
- canary
- nightly
- latest
- beta
- alpha
# Run `npm run bump` to bump the version and create a git tag.
push:
tags:
- 'v*'

dry_run:
type: boolean
description: 'DryRun release'
required: true
default: false
workflow_dispatch:

permissions:
contents: write
# To publish packages with provenance
id-token: write

jobs:
release:
name: Release
publish:
runs-on: ubuntu-latest
environment: npm
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Pnpm
run: |
npm install -g corepack@latest
corepack enable
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'pnpm'
node-version: 24.11.1

# Update npm to the latest version to enable OIDC
- name: Update npm
# Use corepack to install pnpm
- name: Setup Package Managers
run: |
npm install -g npm@latest
npm --version
npm install -g corepack@latest --force
corepack enable
- name: Install Dependencies
run: pnpm install

- name: Run Test
run: pnpm run test
- name: Build
run: pnpm run build

- name: Try release to npm
run: pnpm run release
env:
DRY_RUN: ${{ inputs.dry_run }}
TAG: ${{ inputs.tag }}
VERSION: ${{ inputs.version }}
- name: Publish
uses: JS-DevTools/npm-publish@v4
with:
token: empty

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: 'true'
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"prettier:ci": "prettier --check .",
"test:install": "cross-env ./node_modules/.bin/puppeteer browsers install chrome",
"test": "pnpm run test:install && pnpm run build && cross-env NO_COLOR=1 node --expose-gc --max-old-space-size=8192 --experimental-vm-modules ./node_modules/jest-cli/bin/jest --colors",
"release": "node ./scripts/release.mjs"
"bump": "npx bumpp"
},
"simple-git-hooks": {
"pre-commit": "npx nano-staged"
Expand Down Expand Up @@ -70,8 +70,6 @@
"cross-env": "^7.0.3",
"css-loader": "^7.1.2",
"connect": "^3.7.0",
"execa": "9.3.0",
"fs-extra": "11.2.0",
"graceful-fs": "4.2.10",
"http-proxy": "^1.18.1",
"hono": "^4.6.8",
Expand All @@ -84,7 +82,6 @@
"puppeteer": "^24.34.0",
"react-refresh": "0.14.0",
"require-from-string": "^2.0.2",
"semver": "7.6.3",
"simple-git-hooks": "^2.11.1",
"sockjs-client": "^1.6.1",
"style-loader": "^4.0.0",
Expand Down
Loading
Loading