Merge pull request #313 from trycua/feature/typescript/versioning

[Typescript] Publish packages based on package.json.
This commit is contained in:
Morgan Dean
2025-07-02 12:41:59 -07:00
committed by GitHub
3 changed files with 33 additions and 11 deletions

View File

@@ -2,8 +2,7 @@ name: Publish @trycua/computer to npm
on:
push:
tags:
- "computer-v*"
branches: main
jobs:
publish:
@@ -20,16 +19,28 @@ jobs:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
- name: Check if version changed
id: check-version
uses: EndBug/version-check@v2
with:
file-name: libs/typescript/computer/package.json
static-checking: localIsNew
diff-search: true
- name: Install dependencies
if: steps.check-version.outputs.changed == 'true'
working-directory: ./libs/typescript/computer
run: npm ci
run: pnpm install --frozen-lockfile
- name: Build package
if: steps.check-version.outputs.changed == 'true'
working-directory: ./libs/typescript/computer
run: npm run build --if-present
run: pnpm run build --if-present
- name: Publish to npm
if: steps.check-version.outputs.changed == 'true'
working-directory: ./libs/typescript/computer
run: npm publish --provenance --access public
run: pnpm publish --access public --no-git-checks
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -2,8 +2,7 @@ name: Publish @trycua/core to npm
on:
push:
tags:
- "core-v*"
branches: main
jobs:
publish:
@@ -20,16 +19,28 @@ jobs:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
- name: Check if version changed
id: check-version
uses: EndBug/version-check@v2
with:
file-name: libs/typescript/core/package.json
static-checking: localIsNew
diff-search: true
- name: Install dependencies
if: steps.check-version.outputs.changed == 'true'
working-directory: ./libs/typescript/core
run: npm ci
run: pnpm install --frozen-lockfile
- name: Build package
if: steps.check-version.outputs.changed == 'true'
working-directory: ./libs/typescript/core
run: npm run build --if-present
run: pnpm run build --if-present
- name: Publish to npm
if: steps.check-version.outputs.changed == 'true'
working-directory: ./libs/typescript/core
run: npm publish --provenance --access public
run: pnpm publish --access public --no-git-checks
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -3,7 +3,7 @@ import { defineConfig } from 'tsdown';
export default defineConfig([
{
entry: ['./src/index.ts'],
platform: 'neutral',
platform: 'node',
dts: true,
},
]);