Skip to content

Commit

Permalink
ci: Publish to self-hosted registry
Browse files Browse the repository at this point in the history
  • Loading branch information
noClaps committed Dec 29, 2024
1 parent 0ecfffe commit 34421cf
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 26 deletions.
47 changes: 39 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,38 @@ jobs:
strategy:
matrix:
versions:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
# - os: windows-latest
# target: x86_64-pc-windows-msvc
filename: highlight.darwin-arm64.node
out_dir: darwin-arm64
- os: macos-latest
target: x86_64-apple-darwin
filename: highlight.darwin-x64.node
out_dir: darwin-x64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
filename: highlight.linux-arm64-gnu.node
out_dir: linux-arm64-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
filename: highlight.linux-arm64-musl.node
out_dir: linux-arm64-musl
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
filename: highlight.linux-x64-gnu.node
out_dir: linux-x64-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
filename: highlight.linux-x64-musl.node
out_dir: linux-x64-musl
- os: windows-latest
target: aarch64-pc-windows-msvc
filename: highlight.win32-arm64-msvc.node
out_dir: win32-arm64-msvc
- os: windows-latest
target: x86_64-pc-windows-msvc
filename: highlight.win32-x64-msvc.node
out_dir: win32-x64-msvc
runs-on: ${{ matrix.versions.os }}
name: ${{ matrix.versions.os }}-${{ matrix.versions.target }}
steps:
Expand All @@ -28,12 +52,18 @@ jobs:
with:
targets: ${{ matrix.versions.target }}
- uses: mlugg/setup-zig@v1
- uses: actions/setup-node@v4
with:
registry: "https://npm.zerolimits.dev"
- run: bun install
- run: bun run build --target ${{ matrix.versions.target }}
- run: mv ${{ matrix.versions.filename }} packages/${{ matrix.versions.out_dir }}/${{ matrix.versions.filename }}
- uses: actions/upload-artifact@v4
with:
name: highlight-${{ matrix.versions.target }}
path: dist/
- run: cd packages/${{ matrix.versions.out_dir }}/${{ matrix.versions.filename }}
- run: bun publish

publish:
needs: build
Expand All @@ -48,6 +78,7 @@ jobs:
path: dist/
merge-multiple: true
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
bun-version: latest
- run: bunx jsr publish
registry: "https://npm.zerolimits.dev"
- run: bun publish
16 changes: 0 additions & 16 deletions jsr.json

This file was deleted.

23 changes: 21 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@
"@napi-rs/cli": "^2.18.4",
"@types/bun": "^1.1.14"
},
"optionalDependencies": {
"@noclaps/highlight-darwin-arm64": "^0.3.0",
"@noclaps/highlight-darwin-x64": "^0.3.0",
"@noclaps/highlight-linux-arm64-gnu": "^0.3.0",
"@noclaps/highlight-linux-arm64-musl": "^0.3.0",
"@noclaps/highlight-linux-x64-gnu": "^0.3.0",
"@noclaps/highlight-linux-x64-musl": "^0.3.0",
"@noclaps/highlight-win32-arm64-msvc": "^0.3.0",
"@noclaps/highlight-win32-x64-msvc": "^0.3.0"
},
"scripts": {
"build": "napi build --release ./dist --platform"
"build": "napi build --platform --js ./dist/index.js --dts ./dist/index.d.ts"
},
"napi": {
"name": "highlight",
Expand All @@ -21,5 +31,14 @@
]
}
},
"type": "module"
"type": "module",
"exports": "./index.ts",
"files": [
"dist",
"bun.lockb",
"index.ts",
"LICENSE",
"README.md",
"package.json"
]
}
16 changes: 16 additions & 0 deletions packages/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@noclaps/highlight-darwin-arm64",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.darwin-arm64.node",
"files": [
"highlight.darwin-arm64.node",
"package.json"
],
"os": [
"darwin"
],
"cpu": [
"arm64"
]
}
16 changes: 16 additions & 0 deletions packages/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@noclaps/highlight-darwin-x64",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.darwin-x64.node",
"files": [
"highlight.darwin-x64.node",
"package.json"
],
"os": [
"darwin"
],
"cpu": [
"x64"
]
}
19 changes: 19 additions & 0 deletions packages/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@noclaps/highlight-linux-arm64-gnu",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.linux-arm64-gnu.node",
"files": [
"highlight.linux-arm64-gnu.node",
"package.json"
],
"os": [
"linux"
],
"libc": [
"glibc"
],
"cpu": [
"arm64"
]
}
19 changes: 19 additions & 0 deletions packages/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@noclaps/highlight-linux-arm64-musl",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.linux-arm64-musl.node",
"files": [
"highlight.linux-arm64-musl.node",
"package.json"
],
"os": [
"linux"
],
"libc": [
"musl"
],
"cpu": [
"arm64"
]
}
19 changes: 19 additions & 0 deletions packages/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@noclaps/highlight-linux-x64-gnu",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.linux-x64-gnu.node",
"files": [
"highlight.linux-x64-gnu.node",
"package.json"
],
"os": [
"linux"
],
"libc": [
"glibc"
],
"cpu": [
"x64"
]
}
19 changes: 19 additions & 0 deletions packages/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@noclaps/highlight-linux-x64-musl",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.linux-x64-musl.node",
"files": [
"highlight.linux-x64-musl.node",
"package.json"
],
"os": [
"linux"
],
"libc": [
"musl"
],
"cpu": [
"x64"
]
}
19 changes: 19 additions & 0 deletions packages/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@noclaps/highlight-win32-arm64-msvc",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.win32-arm64-msvc.node",
"files": [
"highlight.win32-arm64-msvc.node",
"package.json"
],
"os": [
"win32"
],
"libc": [
"msvc"
],
"cpu": [
"arm64"
]
}
19 changes: 19 additions & 0 deletions packages/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@noclaps/highlight-win32-x64-msvc",
"version": "0.3.0",
"type": "module",
"exports": "./highlight.win32-x64-msvc.node",
"files": [
"highlight.win32-x64-msvc.node",
"package.json"
],
"os": [
"win32"
],
"libc": [
"msvc"
],
"cpu": [
"x64"
]
}

0 comments on commit 34421cf

Please sign in to comment.