Skip to content

Commit e714d51

Browse files
committed
build: cleanup of python and node builds
1 parent 9454491 commit e714d51

21 files changed

Lines changed: 226 additions & 109 deletions

.github/actionlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
self-hosted-runner:
2+
labels:
3+
- ubuntu-24.04-arm
4+
- windows-11-arm

.github/workflows/publish-node.yml

Lines changed: 78 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,39 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
include:
28+
# macOS — both archs build natively on arm64 runner
29+
- os: macos-latest
30+
target: aarch64-apple-darwin
31+
32+
# Linux (glibc) — native runners per arch
2833
- os: ubuntu-latest
2934
target: x86_64-unknown-linux-gnu
30-
- os: ubuntu-latest
35+
- os: ubuntu-24.04-arm
3136
target: aarch64-unknown-linux-gnu
32-
- os: macos-latest
33-
target: aarch64-apple-darwin
37+
38+
# Linux (musl) — native runners per arch
39+
- os: ubuntu-latest
40+
target: x86_64-unknown-linux-musl
41+
- os: ubuntu-24.04-arm
42+
target: aarch64-unknown-linux-musl
43+
44+
# Windows — native runners per arch
3445
- os: windows-latest
3546
target: x86_64-pc-windows-msvc
47+
- os: windows-11-arm
48+
target: aarch64-pc-windows-msvc
3649
steps:
3750
- uses: actions/checkout@v4
3851

39-
- uses: dtolnay/rust-toolchain@stable
52+
- name: Remove rust-toolchain.toml
53+
shell: bash
54+
run: rm -f rust-toolchain.toml
55+
56+
- uses: dtolnay/rust-toolchain@master
4057
with:
58+
toolchain: "1.93"
4159
targets: ${{ matrix.target }}
60+
components: clippy,rustfmt
4261

4362
- uses: actions/setup-node@v4
4463
with:
@@ -51,16 +70,22 @@ jobs:
5170
working-directory: packages/auths-node
5271
run: pnpm install
5372

54-
- name: Install cross-compilation tools (Linux ARM64)
55-
if: matrix.target == 'aarch64-unknown-linux-gnu'
73+
- name: Install musl tools (Linux x64)
74+
if: matrix.target == 'x86_64-unknown-linux-musl'
75+
run: |
76+
sudo apt-get update
77+
sudo apt-get install -y musl-tools
78+
79+
- name: Install musl tools (Linux arm64)
80+
if: matrix.target == 'aarch64-unknown-linux-musl'
5681
run: |
5782
sudo apt-get update
58-
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
83+
sudo apt-get install -y musl-tools
5984
6085
- name: Build native module
6186
working-directory: packages/auths-node
6287
env:
63-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: ${{ matrix.target == 'aarch64-unknown-linux-gnu' && 'aarch64-linux-gnu-gcc' || '' }}
88+
RUSTUP_TOOLCHAIN: "1.93"
6489
run: pnpm build -- --target ${{ matrix.target }}
6590

6691
- uses: actions/upload-artifact@v4
@@ -78,8 +103,12 @@ jobs:
78103
include:
79104
- os: ubuntu-latest
80105
artifact: bindings-x86_64-unknown-linux-gnu
81-
- os: macos-14
106+
- os: ubuntu-24.04-arm
107+
artifact: bindings-aarch64-unknown-linux-gnu
108+
- os: macos-latest
82109
artifact: bindings-aarch64-apple-darwin
110+
- os: windows-latest
111+
artifact: bindings-x86_64-pc-windows-msvc
83112
steps:
84113
- uses: actions/checkout@v4
85114

@@ -108,9 +137,48 @@ jobs:
108137
working-directory: packages/auths-node
109138
run: pnpm test
110139

140+
universal-macos:
141+
name: Universal macOS binary
142+
needs: [build]
143+
runs-on: macos-latest
144+
steps:
145+
- uses: actions/checkout@v4
146+
147+
- uses: actions/setup-node@v4
148+
with:
149+
node-version: 22
150+
151+
- name: Install pnpm
152+
run: npm install -g pnpm
153+
154+
- name: Install dependencies
155+
working-directory: packages/auths-node
156+
run: pnpm install
157+
158+
- uses: actions/download-artifact@v4
159+
with:
160+
name: bindings-aarch64-apple-darwin
161+
path: packages/auths-node/artifacts
162+
163+
- uses: actions/download-artifact@v4
164+
with:
165+
name: bindings-x86_64-apple-darwin
166+
path: packages/auths-node/artifacts
167+
168+
- name: Build universal binary
169+
working-directory: packages/auths-node
170+
run: |
171+
pnpm artifacts
172+
pnpm universal
173+
174+
- uses: actions/upload-artifact@v4
175+
with:
176+
name: bindings-universal-apple-darwin
177+
path: packages/auths-node/auths.darwin-universal.node
178+
111179
publish:
112180
name: Publish to npm
113-
needs: [build, test]
181+
needs: [build, test, universal-macos]
114182
runs-on: ubuntu-latest
115183
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'npm')
116184
permissions:

.github/workflows/publish-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
id-token: write
117117
environment:
118118
name: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi') && 'testpypi' || 'pypi' }}
119-
url: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi') && 'https://test.pypi.org/p/auths-python' || 'https://pypi.org/p/auths-python' }}
119+
url: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi') && 'https://test.pypi.org/p/auths' || 'https://pypi.org/p/auths' }}
120120
steps:
121121
- uses: actions/download-artifact@v4
122122
with:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test Windows CLI Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Rust toolchain
16+
run: |
17+
rustup toolchain install 1.93 --profile minimal
18+
rustup default 1.93
19+
rustup target add x86_64-pc-windows-msvc
20+
21+
- uses: Swatinem/rust-cache@v2
22+
with:
23+
key: x86_64-pc-windows-msvc
24+
25+
- name: Build CLI
26+
run: cargo build --release --package auths-cli --target x86_64-pc-windows-msvc
27+
28+
- name: Verify binary
29+
run: |
30+
dir target\x86_64-pc-windows-msvc\release\auths.exe
31+
target\x86_64-pc-windows-msvc\release\auths.exe --version
32+
target\x86_64-pc-windows-msvc\release\auths.exe --help
33+
34+
- name: Package
35+
run: |
36+
New-Item -ItemType Directory -Force -Path staging
37+
Copy-Item target/x86_64-pc-windows-msvc/release/auths.exe staging/
38+
Copy-Item target/x86_64-pc-windows-msvc/release/auths-sign.exe staging/ -ErrorAction SilentlyContinue
39+
Copy-Item target/x86_64-pc-windows-msvc/release/auths-verify.exe staging/ -ErrorAction SilentlyContinue
40+
Compress-Archive -Path staging/* -DestinationPath auths-windows-x86_64.zip
41+
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: auths-windows-x86_64
45+
path: auths-windows-x86_64.zip

docs/sdk/node/errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ AuthsError
2121
All SDK errors extend `AuthsError`, so a single catch handles everything:
2222

2323
```typescript
24-
import { AuthsError } from '@auths-dev/node'
24+
import { AuthsError } from '@auths-dev/sdk'
2525

2626
try {
2727
auths.signAs({ message: data, identityDid: did })
@@ -35,7 +35,7 @@ try {
3535
For finer control, catch specific subclasses:
3636

3737
```typescript
38-
import { CryptoError, KeychainError, NetworkError } from '@auths-dev/node'
38+
import { CryptoError, KeychainError, NetworkError } from '@auths-dev/sdk'
3939

4040
try {
4141
auths.signAs({ message: data, identityDid: did })

docs/sdk/node/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Full-featured Node.js SDK for Auths decentralized identity, backed by Rust via n
55
## Installation
66

77
```bash
8-
npm install @auths-dev/node
8+
npm install @auths-dev/sdk
99
```
1010

1111
Pre-built native binaries for Linux, macOS, and Windows (x86_64 and aarch64). No Rust toolchain required. Requires Node.js 20+.
1212

1313
## Quick taste
1414

1515
```typescript
16-
import { Auths } from '@auths-dev/node'
16+
import { Auths } from '@auths-dev/sdk'
1717

1818
const auths = new Auths()
1919
const identity = auths.identities.create({ label: 'laptop' })

docs/sdk/node/quickstart.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
## Install
44

55
```bash
6-
npm install @auths-dev/node
6+
npm install @auths-dev/sdk
77
```
88

99
## Create an identity and sign a commit
1010

1111
```typescript
12-
import { Auths } from '@auths-dev/node'
12+
import { Auths } from '@auths-dev/sdk'
1313

1414
const auths = new Auths()
1515
const identity = auths.identities.create({ label: 'laptop' })
@@ -36,7 +36,7 @@ console.log(`Device: ${device.did}`)
3636
## Verify a single attestation
3737

3838
```typescript
39-
import { verifyAttestation } from '@auths-dev/node'
39+
import { verifyAttestation } from '@auths-dev/sdk'
4040

4141
const result = await verifyAttestation(attestationJson, publicKeyHex)
4242
console.log(`Valid: ${result.valid}`)
@@ -45,7 +45,7 @@ console.log(`Valid: ${result.valid}`)
4545
## Verify a chain
4646

4747
```typescript
48-
import { verifyChain } from '@auths-dev/node'
48+
import { verifyChain } from '@auths-dev/sdk'
4949

5050
const report = await verifyChain(attestationChain, rootPublicKeyHex)
5151
console.log(`Chain status: ${report.status.statusType}`) // 'Valid'
@@ -54,7 +54,7 @@ console.log(`Chain status: ${report.status.statusType}`) // 'Valid'
5454
## Build a policy
5555

5656
```typescript
57-
import { PolicyBuilder } from '@auths-dev/node'
57+
import { PolicyBuilder } from '@auths-dev/sdk'
5858

5959
const policy = new PolicyBuilder()
6060
.notRevoked()
@@ -111,7 +111,7 @@ const members = auths.orgs.listMembers({ orgDid: org.orgDid })
111111
## Error handling
112112

113113
```typescript
114-
import { Auths, CryptoError, KeychainError, AuthsError } from '@auths-dev/node'
114+
import { Auths, CryptoError, KeychainError, AuthsError } from '@auths-dev/sdk'
115115

116116
try {
117117
auths.signAs({ message: data, identityDid: 'did:keri:nonexistent' })

docs/sdk/python/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Full-featured Python SDK for Auths decentralized identity, backed by Rust via Py
55
## Installation
66

77
```bash
8-
pip install auths-python
8+
pip install auths
99
```
1010

1111
Pre-built wheels for Linux, macOS, and Windows (Python 3.8+ via ABI3). No Rust toolchain required.
1212

1313
For JWT token verification, install the optional dependency:
1414

1515
```bash
16-
pip install auths-python[jwt]
16+
pip install auths[jwt]
1717
```
1818

1919
## Quick taste

docs/sdk/python/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Install
44

55
```bash
6-
pip install auths-python
6+
pip install auths
77
```
88

99
## Create an identity and sign a commit

packages/auths-node/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Decentralized identity for developers and AI agents. Sign, verify, and manage cr
55
## Install
66

77
```bash
8-
npm install @auths-dev/node
8+
npm install @auths-dev/sdk
99
```
1010

1111
## Quick start
1212

1313
```typescript
14-
import { Auths, verifyAttestation } from '@auths-dev/node'
14+
import { Auths, verifyAttestation } from '@auths-dev/sdk'
1515

1616
const auths = new Auths()
1717

@@ -28,7 +28,7 @@ console.log(sig.signature) // hex-encoded Ed25519 signature
2828
## Identity management
2929

3030
```typescript
31-
import { Auths } from '@auths-dev/node'
31+
import { Auths } from '@auths-dev/sdk'
3232

3333
const auths = new Auths({ repoPath: '~/.auths' })
3434

@@ -64,7 +64,7 @@ auths.devices.revoke({
6464
## Policy engine
6565

6666
```typescript
67-
import { PolicyBuilder, evaluatePolicy } from '@auths-dev/node'
67+
import { PolicyBuilder, evaluatePolicy } from '@auths-dev/sdk'
6868

6969
// Build a standard policy
7070
const policy = PolicyBuilder.standard('sign_commit')
@@ -109,7 +109,7 @@ import {
109109
verifyAttestation,
110110
verifyChain,
111111
verifyAttestationWithCapability,
112-
} from '@auths-dev/node'
112+
} from '@auths-dev/sdk'
113113

114114
// Single attestation
115115
const result = verifyAttestation(attestationJson, issuerPublicKeyHex)
@@ -127,7 +127,7 @@ const capResult = verifyAttestationWithCapability(
127127
## Error handling
128128

129129
```typescript
130-
import { Auths, VerificationError, CryptoError, NetworkError } from '@auths-dev/node'
130+
import { Auths, VerificationError, CryptoError, NetworkError } from '@auths-dev/sdk'
131131

132132
const auths = new Auths()
133133
try {

0 commit comments

Comments
 (0)