-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up the publish GitHub action with release-it
- Loading branch information
Showing
4 changed files
with
2,115 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: publish-package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
increment: | ||
type: choice | ||
description: Version increment (defaults to minor) | ||
default: minor | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
- premajor | ||
- preminor | ||
- prepatch | ||
prerelease: | ||
type: choice | ||
description: Make the release a beta or alpha prerelease | ||
default: "no" | ||
options: | ||
- "no" | ||
- beta | ||
- alpha | ||
|
||
jobs: | ||
publish-package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: latest | ||
run_install: true | ||
|
||
- name: Setup git | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- name: Build package | ||
run: pnpm build | ||
|
||
- name: Publish package | ||
if: "${{ inputs.prerelease == 'no' || inputs.prerelease == '' }}" | ||
run: pnpm release --increment ${{ inputs.increment }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Prepublish package | ||
if: "${{ inputs.prerelease != 'no' && inputs.prerelease != '' }}" | ||
run: pnpm release ${{ inputs.increment }} --preRelease ${{ inputs.prerelease }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "three-panorama-controls", | ||
"version": "1.0.0", | ||
"version": "0.0.0", | ||
"description": "Panorama controls for three.js.", | ||
"author": "Fawad Ali <[email protected]>", | ||
"license": "Apache-2.0", | ||
|
@@ -47,7 +47,8 @@ | |
"build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types", | ||
"build:cjs": "pnpm tsc --project ./tsconfig.cjs.json --outDir ./dist/cjs/ --declaration false", | ||
"build:esm": "pnpm tsc --project ./tsconfig.esm.json --outDir ./dist/esm/ --declaration false", | ||
"build:types": "pnpm tsc --emitDeclarationOnly true --declarationDir ./dist/types" | ||
"build:types": "pnpm tsc --emitDeclarationOnly true --declarationDir ./dist/types", | ||
"release": "release-it" | ||
}, | ||
"peerDependencies": { | ||
"@react-three/fiber": ">= 8", | ||
|
@@ -61,6 +62,7 @@ | |
"@types/three": "^0.168.0", | ||
"eslint": "^9.10.0", | ||
"globals": "^15.9.0", | ||
"release-it": "^17.6.0", | ||
"typescript": "^5.5.4", | ||
"typescript-eslint": "^8.4.0" | ||
}, | ||
|
Oops, something went wrong.