Skip to content

Commit

Permalink
chore: update npm-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shijistar committed Feb 4, 2025
1 parent 864c729 commit 1988968
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package
name: Publish to npm

on:
release:
Expand All @@ -11,23 +11,44 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

# Uncomment the following line if you want to run tests
# - name: Run tests
# run: pnpm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Publish to npm
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.tiny_codes_token}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"bin": {
"swagger-api-hub": "./bin/swagger-api-hub.js"
"swagger-api-hub": "bin/swagger-api-hub.js"
},
"files": [
"bin",
Expand Down

0 comments on commit 1988968

Please sign in to comment.