Skip to content

Commit d119548

Browse files
committed
Create update-api.yml and fix related code
1 parent 8a40090 commit d119548

10 files changed

Lines changed: 413 additions & 321 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
- name: Install dependencies
2424
run: bun install --frozen-lockfile
2525

26-
- name: Typecheck code
27-
run: bun run typecheck
28-
2926
- name: Build
3027
run: bun run build
3128

29+
- name: Typecheck code
30+
run: bun run typecheck
31+
3232
- name: Run tests
3333
run: bun run test

.github/workflows/update-api.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Update API
2+
3+
on:
4+
schedule:
5+
- cron: "0 3 * * 1"
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-api:
10+
name: Update API
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19+
20+
- name: Checkout lichess-org/api
21+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
22+
with:
23+
repository: lichess-org/api
24+
ref: master
25+
path: lichess-api
26+
fetch-depth: 1
27+
28+
- name: Copy files
29+
run: |
30+
rm -rf specs/*
31+
32+
mkdir -p specs/schemas specs/tags
33+
34+
cp -r lichess-api/doc/specs/schemas/. specs/schemas/
35+
cp -r lichess-api/doc/specs/tags/. specs/tags/
36+
cp lichess-api/doc/specs/lichess-api.yaml specs/lichess-api.yaml
37+
38+
rm -rf lichess-api
39+
40+
- name: Setup Bun
41+
uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0
42+
with:
43+
bun-version-file: ".bun-version"
44+
45+
- name: Install dependencies
46+
run: bun ci
47+
48+
- name: Generate files
49+
run: bun run gen
50+
51+
- name: Build
52+
run: bun run build
53+
54+
- name: Run tests
55+
run: bun run test
56+
57+
- name: Create or update Pull Request
58+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
59+
with:
60+
commit-message: "ci: update api"
61+
title: "ci: update api"
62+
committer: CI <ci@rman.dev>
63+
author: CI <ci@rman.dev>
64+
body: Update API
65+
branch: update-api
66+
delete-branch: true
67+
assignees: gameroman
68+
reviewers: gameroman
69+
labels: ci

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"gen": "bun run gen:schemas && bun run gen:client && bun run format",
1111
"test": "bun test",
1212
"typecheck": "tsc --noEmit",
13-
"format": "biome format --write",
13+
"format": "biome check --write --linter-enabled=false",
1414
"build": "bunx --bun tsdown",
1515
"prepublishOnly": "bun run build"
1616
},
@@ -32,8 +32,6 @@
3232
"@typescript/native-preview": "^7.0.0-dev.20260124.1",
3333
"tsdown": "^0.20.1"
3434
},
35-
"main": "./dist/index.mjs",
36-
"module": "./dist/index.mjs",
3735
"types": "./dist/index.d.mts",
3836
"exports": {
3937
".": "./dist/index.mjs",

0 commit comments

Comments
 (0)