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
80 changes: 0 additions & 80 deletions .github/workflows/ci.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ jobs:
node-version-file: '.nvmrc'

- name: Setup pnpm
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Get pnpm store directory
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
branches: [main]

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

jobs:
release:
name: Release
if: github.repository == 'TxnLab/nfd-sdk'
runs-on: ubuntu-latest

steps:
- name: Generate release token
id: generate_token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.RELEASE_BOT_APP_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
token: ${{ steps.generate_token.outputs.token }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Update npm to latest
run: npm install -g npm@latest

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run CI checks
run: pnpm run ci

- name: Verify dependency signatures
run: npm audit signatures

- name: Release
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
GIT_AUTHOR_NAME: TxnLab Release Bot[bot]
GIT_AUTHOR_EMAIL: txnlab-release-bot[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: TxnLab Release Bot[bot]
GIT_COMMITTER_EMAIL: txnlab-release-bot[bot]@users.noreply.github.com
run: npx semantic-release
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pnpm-lock.yaml
**/*.gen.ts
**/*.arc56.json
**/contracts/*Client.ts
**/CHANGELOG.md

# Coverage reports
coverage
Expand Down
62 changes: 62 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
export default {
branches: ['main'],
tagFormat: 'v${version}',
pkgRoot: 'packages/sdk',
plugins: [
'@semantic-release/commit-analyzer',
[
'@semantic-release/release-notes-generator',
{
preset: 'angular',
presetConfig: {
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'refactor', section: 'Code Refactoring' },
{ type: 'perf', section: 'Performance Improvements' },
{ type: 'docs', section: 'Documentation', hidden: true },
{ type: 'style', section: 'Styles', hidden: true },
{ type: 'chore', section: 'Miscellaneous Chores', hidden: true },
{ type: 'test', section: 'Tests', hidden: true },
{ type: 'build', section: 'Build System', hidden: true },
{ type: 'ci', section: 'Continuous Integration', hidden: true },
],
},
writerOpts: {
commitsSort: false,
commitGroupsSort: (a, b) => {
const order = [
'Features',
'Bug Fixes',
'Code Refactoring',
'Performance Improvements',
]
const aIndex = order.indexOf(a.title)
const bIndex = order.indexOf(b.title)
// Put items not in the list at the end
if (aIndex === -1 && bIndex === -1) return 0
if (aIndex === -1) return 1
if (bIndex === -1) return -1
return aIndex - bIndex
},
},
},
],
[
'@semantic-release/changelog',
{
changelogFile: 'packages/sdk/CHANGELOG.md',
},
],
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['packages/sdk/CHANGELOG.md', 'packages/sdk/package.json'],
message:
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
],
}
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
"private": true,
"description": "Monorepo for NFDomains SDK and related packages",
"type": "module",
"packageManager": "pnpm@10.30.3",
"scripts": {
"build": "pnpm --filter @txnlab/nfd-sdk build",
"build:examples": "pnpm --filter './examples/*' build",
"test": "pnpm -r test",
"lint": "pnpm -r lint",
"format": "pnpm -r format",
"typecheck": "pnpm --filter @txnlab/nfd-sdk typecheck",
"cipublish": "node scripts/publish.js",
"ci": "pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build && pnpm run build:examples",
"release": "pnpm run ci && semantic-release",
"fresh-install": "rm -rf node_modules packages/*/node_modules examples/*/node_modules && pnpm install"
},
"keywords": [
Expand All @@ -33,10 +35,16 @@
"homepage": "https://github.com/TxnLab/nfd-sdk#readme",
"engines": {
"node": ">=22",
"pnpm": ">=9"
"pnpm": ">=10"
},
"devDependencies": {
"@eslint/js": "^9.21.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^12.0.8",
"@semantic-release/npm": "^13.1.5",
"@semantic-release/release-notes-generator": "^14.1.1",
"@tanstack/config": "^0.16.2",
"@typescript-eslint/eslint-plugin": "^8.24.1",
"@typescript-eslint/parser": "^8.24.1",
Expand All @@ -50,6 +58,7 @@
"eslint-plugin-unicorn": "^57.0.0",
"globals": "^14.0.0",
"prettier": "^3.5.1",
"semantic-release": "^25.0.3",
"typescript": "^5.5.3"
},
"pnpm": {
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
5 changes: 3 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@
},
"homepage": "https://github.com/TxnLab/nfd-sdk#readme",
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},
"engines": {
"node": ">=22",
"pnpm": ">=9"
"pnpm": ">=10"
},
"scripts": {
"build": "vite build && publint --strict",
Expand Down
Loading
Loading