Skip to content

Commit

Permalink
add publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Armaldio committed Sep 25, 2024
1 parent 5255774 commit 4ff00a9
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 3 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Node.js Package to npm and gpr

# trigger when a release is created
on:
push:
tags:
- "**"

jobs:
build:
permissions:
contents: read
id-token: write
packages: write
attestations: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm test

# publish to npm
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v4
- run: pnpm npm install
- run: pnpm npm run build
- run: pnpm npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM_TOKEN}}

# publish to gpr
publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: https://npm.pkg.github.com/
scope: "@cyn"
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm run build
- run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_GITHUB_TOKEN}}
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{
"name": "@cyn/core",
"version": "1.0.0",
"version": "1.1.0",
"description": "",
"main": "dist/index.js",
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"build": "tsc"
"build": "tsc",
"test": "echo 0"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/CynToolkit/core"
},
"keywords": [],
"author": "Armaldio",
"license": "LICENSE.md",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"outDir": "dist"
"outDir": "dist",
"types": ["node"]
}
}

0 comments on commit 4ff00a9

Please sign in to comment.