-
Notifications
You must be signed in to change notification settings - Fork 145
80 lines (70 loc) · 1.93 KB
/
d-ts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: d.ts Exporter
on:
workflow_dispatch:
schedule:
- cron: '37 15 * * 4'
jobs:
export:
name: "Export (${{ matrix.branch }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch:
- '6.0'
- '6.1'
steps:
- run: |
sudo apt-get install -y \
jq \
moreutils
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Determine commit
id: determine-commit
run: |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Set up node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- run: npm install
- uses: actions/checkout@v4
with:
repository: WoltLab/d.ts
ssh-key: ${{ secrets.WOLTLAB_D_TS_DEPLOY_KEY }}
path: d.ts
ref: ${{ matrix.branch }}
- name: Update the .d.ts files
run: |
npx tsc --declaration --emitDeclarationOnly --outdir ./d.ts/
cp ./ts/global.d.ts ./d.ts/
- name: Update dependencies in package.json
run: |
set -x
cd d.ts/
jq --argfile dependencies ../package.json '.dependencies = ($dependencies |.dependencies)' ./package.json \
|sponge ./package.json
if ! git diff --quiet package.json; then
npm install
fi
cd ../
- name: Prepare git
run: |
git config --global user.name "WoltLab GmbH"
git config --global user.email "[email protected]"
- name: Push the update
run: |
set -x
cd d.ts/
git add .
if git diff --cached --quiet; then
exit 0
fi
git commit -m "Update ${{ github.repository }} definitions
Generated using:
npx tsc --declaration --emitDeclarationOnly --outdir ./d.ts/
from ${{ github.repository }}@${{ steps.determine-commit.outputs.sha }}"
git push