Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .c8rc.json

This file was deleted.

10 changes: 10 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.29.2",
"commands": ["dotnet-csharpier"]
}
}
}
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @mxsdev
* @seamapi/sdk
46 changes: 46 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Setup Node.js
description: Setup Node.js and install dependencies.

inputs:
node_version:
description: The Node.js version.
required: false
default: '24'
registry_url:
description: The Node.js package registry URL.
required: false
default: https://registry.npmjs.org
install_dependencies:
description: Install dependencies.
required: false
default: 'true'

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'true'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Setup Node.js without cache
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'false'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Install dependencies
if: inputs.install_dependencies == 'true'
shell: bash
run: npm ci --ignore-scripts
- name: Rebuild Node.js modules
shell: bash
run: npm rebuild
- name: Run postinstall script
shell: bash
run: npm run postinstall --if-present
- name: Run prepare script
shell: bash
run: npm run prepare --if-present
64 changes: 22 additions & 42 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
---
name: Setup
description: Setup Node.js and install dependencies.
description: Setup .NET and install dependencies.

inputs:
node_auth_token:
description: The Node.js auth token.
required: true
node_version:
description: The Node.js version.
dotnet_version:
description: The .NET SDK versions to install.
required: false
default: '24'
registry_url:
description: The Node.js package registry URL.
required: false
default: https://npm.pkg.github.com
default: |
8.0.x
10.0.x
install_dependencies:
description: Install dependencies.
required: false
Expand All @@ -22,39 +17,24 @@ inputs:
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'true'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Setup Node.js without cache
uses: actions/setup-node@v7
if: inputs.install_dependencies == 'false'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
7.0.x
6.0.x
- name: Setup CSharpier
shell: bash
run: dotnet tool install csharpier -g --version 0.29.2
- name: Install dependencies
dotnet-version: ${{ inputs.dotnet_version }}
- name: Setup just
uses: extractions/setup-just@v4
- name: Cache NuGet packages
if: inputs.install_dependencies == 'true'
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '.config/dotnet-tools.json') }}
restore-keys: nuget-${{ runner.os }}-
- name: Restore tools
if: inputs.install_dependencies == 'true'
shell: bash
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ inputs.node_auth_token }}
- name: Rebuild Node.js modules
shell: bash
run: npm rebuild
- name: Run postinstall script
shell: bash
run: npm run postinstall --if-present
- name: Run prepare script
run: dotnet tool restore
- name: Restore dependencies
if: inputs.install_dependencies == 'true'
shell: bash
run: npm run prepare --if-present
run: dotnet restore ./output/csharp
21 changes: 8 additions & 13 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ name: _build
on:
workflow_call:
inputs:
node_version:
description: The Node.js version.
dotnet_version:
description: The .NET SDK versions to install.
type: string
required: false
default: '24'
secrets:
node_auth_token:
description: The Node.js auth token.
required: true
default: |
8.0.x
10.0.x
outputs:
artifact_name:
description: The artifact name.
Expand All @@ -29,15 +27,12 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
with:
node_version: ${{ inputs.node_version }}
node_auth_token: ${{ secrets.node_auth_token }}
dotnet_version: ${{ inputs.dotnet_version }}
- name: Build
run: npm run build
- name: Package
run: npm pack
run: just build
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: build-${{ github.sha }}
if-no-files-found: error
path: '*.tgz'
path: pkg/
19 changes: 5 additions & 14 deletions .github/workflows/_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ on:
registry_token:
description: The package registry token.
required: true
node_auth_token:
description: The Node.js auth token.
required: true

jobs:
publish:
Expand All @@ -32,19 +29,13 @@ jobs:
uses: ./.github/actions/setup
with:
install_dependencies: 'false'
node_auth_token: ${{ secrets.node_auth_token }}
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: ${{ inputs.artifact_name }}
path: .
- name: Get meta
id: meta
run: echo "tgz=$(ls *.tgz | head -n1)" >> $GITHUB_OUTPUT
path: pkg/
- name: Publish
uses: JS-DevTools/npm-publish@v4
with:
access: restricted
token: ${{ secrets.registry_token }}
registry: ${{ inputs.registry_url }}
package: ${{ steps.meta.outputs.tgz }}
run: dotnet nuget push "pkg/*.nupkg" --api-key "$REGISTRY_TOKEN" --source "$REGISTRY_URL"
env:
REGISTRY_TOKEN: ${{ secrets.registry_token }}
REGISTRY_URL: ${{ inputs.registry_url }}
115 changes: 81 additions & 34 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ name: Check

on:
push:
branches:
- main
pull_request:
branches:
- '**'

jobs:
test:
name: Test (Node.js v${{ matrix.node }} on ${{ matrix.os_name }})
name: Test (.NET ${{ matrix.framework }} on ${{ matrix.os_name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
node:
- '22'
- '24'
framework:
- net8.0
- net10.0
include:
- os: ubuntu-latest
os_name: Linux
Expand All @@ -27,53 +30,97 @@ jobs:
uses: actions/checkout@v7
- name: Setup
uses: ./.github/actions/setup
with:
node_version: ${{ matrix.node }}
node_auth_token: ${{ secrets.GH_TOKEN }}
- name: Test
run: npm test
run: just test ${{ matrix.framework }}
lint:
name: Lint (Node.js v${{ matrix.node }})
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
node:
- '22'
- '24'
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup
uses: ./.github/actions/setup
with:
node_version: ${{ matrix.node }}
node_auth_token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Lint
run: just lint
- name: Lint with ESLint and Prettier
run: npm run lint
typecheck:
name: Typecheck
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Typecheck
run: npm run typecheck
build:
name: Build
uses: ./.github/workflows/_build.yml
secrets:
node_auth_token: ${{ secrets.GH_TOKEN }}
typecheck:
name: Typecheck (Node.js v${{ matrix.node }})
runs-on: ubuntu-latest
install:
name: Install (.NET ${{ matrix.framework }} on ${{ matrix.os_name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
needs: build
strategy:
fail-fast: false
matrix:
node:
- '22'
- '24'
os:
- ubuntu-latest
framework:
- net8.0
- net10.0
include:
- os: ubuntu-latest
os_name: Linux
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup
uses: ./.github/actions/setup
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
node_version: ${{ matrix.node }}
node_auth_token: ${{ secrets.GH_TOKEN }}
- name: Typecheck
run: npm run typecheck
dotnet-version: |
8.0.x
10.0.x
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: ${{ needs.build.outputs.artifact_name }}
path: pkg/
- name: Get meta
id: meta
run: |
nupkg=$(basename pkg/Seam.*.nupkg .nupkg)
echo "version=${nupkg#Seam.}" >> $GITHUB_OUTPUT
- name: Create project
run: dotnet new console --framework ${{ matrix.framework }} --output smoke
- name: Create nuget.config
uses: DamianReeves/write-file-action@v1.3
with:
write-mode: overwrite
path: smoke/nuget.config
contents: |
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local" value="../pkg" />
</packageSources>
</configuration>
- name: Create Program.cs
uses: DamianReeves/write-file-action@v1.3
with:
write-mode: overwrite
path: smoke/Program.cs
contents: |
using Seam.Client;

var seam = new SeamClient(apiToken: "seam_apikey1_token");
Console.WriteLine($"Constructed {seam.GetType().FullName}");
- name: Install
run: dotnet add smoke package Seam --version "$VERSION"
env:
VERSION: ${{ steps.meta.outputs.version }}
- name: Run
run: dotnet run --project smoke
Loading
Loading