Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit f410454

Browse files
authored
fix: Update tsup to fix build (#231)
* fix: Update tsup to fix build * ci: Add check workflow * ci: Disable test workflow * Do not typecheck on node 18 * Add typecheck script * Remove typecheck job * Run format
1 parent 5536588 commit f410454

6 files changed

Lines changed: 295 additions & 158 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Setup
3+
description: Setup Node.js and install dependencies.
4+
5+
inputs:
6+
node_version:
7+
description: The Node.js version.
8+
required: false
9+
default: "18"
10+
registry_url:
11+
description: The Node.js package registry URL.
12+
required: false
13+
default: https://registry.npmjs.org
14+
install_dependencies:
15+
description: Install dependencies.
16+
required: false
17+
default: "true"
18+
19+
runs:
20+
using: composite
21+
steps:
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v3
24+
if: inputs.install_dependencies == 'true'
25+
with:
26+
cache: npm
27+
node-version: ${{ inputs.node_version }}
28+
registry-url: ${{ inputs.registry_url }}
29+
- name: Setup Node.js without cache
30+
uses: actions/setup-node@v3
31+
if: inputs.install_dependencies == 'false'
32+
with:
33+
node-version: ${{ inputs.node_version }}
34+
registry-url: ${{ inputs.registry_url }}
35+
- name: Install dependencies
36+
if: inputs.install_dependencies == 'true'
37+
shell: bash
38+
run: yarn --frozen-lockfile

.github/workflows/_build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: _build
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
node_version:
8+
description: The Node.js version.
9+
type: string
10+
required: false
11+
default: "18"
12+
outputs:
13+
artifact_name:
14+
description: The artifact name.
15+
value: build-${{ github.sha }}
16+
17+
jobs:
18+
build:
19+
name: Package
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 30
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
- name: Setup
26+
uses: ./.github/actions/setup
27+
with:
28+
node_version: ${{ inputs.node_version }}
29+
- name: Build
30+
run: npm run build
31+
- name: Package
32+
run: npm pack
33+
- name: Upload artifact
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: build-${{ github.sha }}
37+
if-no-files-found: error
38+
path: "*.tgz"

.github/workflows/check.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Check
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- "**"
11+
12+
jobs:
13+
build:
14+
name: Build
15+
uses: ./.github/workflows/_build.yml

.github/workflows/npm-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# gwm: {"type":"npm-test"}
33
name: NPM Test
44
on:
5-
push:
65
workflow_dispatch:
76
inputs:
87
sdkSha:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"semantic-release": "^21.0.5",
8888
"testcontainers": "^9.1.1",
8989
"ts-json-schema-generator": "0.98.0",
90-
"tsup": "5.11.11",
90+
"tsup": "^7.1.0",
9191
"type-fest": "2.11.1",
9292
"typedoc": "0.22.12",
9393
"typedoc-plugin-markdown": "3.11.12",
@@ -111,6 +111,7 @@
111111
"build:json-response-schemas": "ts-json-schema-generator --path src/types/route-responses.ts -o src/types/route-responses.generated.json && ts-json-schema-generator --path src/types/models.ts -o src/types/models.generated.json",
112112
"build": "npm run build:json-response-schemas && npm run build:package && npm run build:docs",
113113
"pack:cli": "pkg -c package.json dist/cli/entry.js",
114+
"typecheck": "tsc --noEmit",
114115
"format": "prettier --write .",
115116
"format:check": "prettier --check .",
116117
"test": "DEBUG=testcontainers* && npm run build:json-response-schemas && ava",

0 commit comments

Comments
 (0)