-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⭐ feat: add new workflow for github releases
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 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,51 @@ | ||
name: Publish and Release Packages | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
release: | ||
name: Create Release and Publish NPM | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# - name: Install pnpm | ||
# uses: pnpm/action-setup@v4 | ||
# with: | ||
# version: 9 | ||
# run_install: false | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
# cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
# run: pnpm install --frozen-lockfile | ||
|
||
- name: Build the package | ||
run: npm run build | ||
|
||
- name: Publish to NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
# body: | | ||
# Changes in this release: | ||
# - New version published to npm: ${{ github.ref }} | ||
files: | | ||
dist/*.js | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |