diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11b8cc70b..200325bc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: CI -on: [pull_request, push] +on: + push: + branches-ignore: + - dev-types permissions: contents: write @@ -83,6 +86,22 @@ jobs: VERSION=dev DATE=${{ github.event.repository.updated_at }} + - name: dev - Publish types + if: github.ref == 'refs/heads/dev' && github.event_name == 'push' + run: | + pnpm run build:types + temp_dir=$(mktemp -d) + cp -R package.json LICENSE dist $temp_dir + git fetch --unshallow + git checkout dev-types + rm -rf * + cp -R $temp_dir/* . + git add -A + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -m "Update" || echo 'Nothing to commit' + git push --force --set-upstream origin dev-types + - name: release - Docker meta if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push' uses: docker/metadata-action@v5 diff --git a/.gitignore b/.gitignore index 7270f2fab..a722fdc2e 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ typings/ # Build cache tsconfig.tsbuildinfo +tsconfig.types.tsbuildinfo # Optional REPL history .node_repl_history diff --git a/package.json b/package.json index ddbf31d0e..65f6b2fe4 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ ], "scripts": { "build": "tsc && node index.js writehash", + "build:types": "pnpm run clean && tsc --project tsconfig.types.json && cp lib/util/settings.schema.json dist/util", "build:watch": "tsc --watch", "check": "biome check", "check:w": "biome check --write", diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100644 index 000000000..add2cb626 --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "emitDeclarationOnly": true + } +}