Skip to content

Commit

Permalink
ref: run publish workflow when making a realease
Browse files Browse the repository at this point in the history
  • Loading branch information
FADHILI-Josue committed Apr 25, 2024
1 parent c3c6221 commit 8f75a2c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
39 changes: 15 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
name: Publish
name: Publish to NPM
on:
push:
branches:
- "master"

concurrency: ${{ github.workflow }}-${{ github.ref }}

release:
types: [created]
jobs:
publish:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies and build 🔧
run: npm ci && npm run build
- name: Publish package on NPM 📦
run: npm publish
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"wifikeys": "./dist/bin.js"
},
"author": "FADHILI Josue <[email protected]>",
"files": [
"./dist/bin.js"
],
"scripts": {
"build": "esbuild --bundle src/bin.ts --platform=node --outfile=dist/bin.js --packages=external --format=esm --minify",
"dev": "run-p dev:*",
Expand Down

0 comments on commit 8f75a2c

Please sign in to comment.