Skip to content

Commit 9123c78

Browse files
committed
Publish to github packages.
1 parent a1554ab commit 9123c78

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
name: Build and Test
44

5-
on: ["push", "pull_request"]
5+
on:
6+
push:
7+
paths-ignore:
8+
- '.github/**'
9+
- 'README.md'
10+
- 'LICENSE.md'
11+
pull_request:
12+
paths-ignore:
13+
- '.github/**'
14+
- 'README.md'
15+
- 'LICENSE.md'
616

717
jobs:
818
test-node:
@@ -47,7 +57,7 @@ jobs:
4757
with:
4858
token: ${{ secrets.CODECOV_TOKEN }}
4959
- name: Upload test results to Codecov
50-
if: matrix.node-version == '22.x' && ${{ !cancelled() }}
60+
if: ${{ matrix.node-version == '22.x' && !cancelled() }}
5161
uses: codecov/test-results-action@v1
5262
with:
5363
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/npm-publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,24 @@ jobs:
3030
run: npm publish --access public
3131
env:
3232
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
34+
- name: Set up Node.js for GitHub Packages
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 22.x
38+
registry-url: 'https://npm.pkg.github.com/'
39+
scope: '@brahma-dev'
40+
41+
- name: Modify package.json for GitHub Packages
42+
run: |
43+
node -e '
44+
const fs = require("fs");
45+
const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
46+
pkg.name = "@brahma-dev/" + pkg.name;
47+
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 2));
48+
'
49+
50+
- name: Publish to GitHub Packages
51+
run: npm publish
52+
env:
53+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)