6e9d183b158e9748a0a7457fdfa5a6fb570747f1
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / .github / workflows / d-ts.yml
1 name: d.ts Exporter
2
3 on:
4 workflow_dispatch:
5 schedule:
6 - cron: '37 15 * * 4'
7
8 jobs:
9 export:
10 name: "Export (${{ matrix.branch }})"
11 runs-on: ubuntu-latest
12 strategy:
13 fail-fast: false
14 matrix:
15 branch:
16 - 'master'
17 steps:
18 - uses: actions/checkout@v3
19 with:
20 ref: ${{ matrix.branch }}
21 - name: Determine commit
22 id: determine-commit
23 run: |
24 echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
25 - name: Set up node.js
26 uses: actions/setup-node@v3
27 with:
28 node-version: "16"
29 cache: "npm"
30 - run: npm install
31 - uses: actions/checkout@v3
32 with:
33 repository: WoltLab/d.ts
34 ssh-key: ${{ secrets.WOLTLAB_D_TS_DEPLOY_KEY }}
35 path: d.ts
36 ref: ${{ matrix.branch }}
37 - run: npx tsc --declaration --emitDeclarationOnly --outdir ./d.ts/
38 - name: Prepare git
39 run: |
40 git config --global user.name "WoltLab GmbH"
41 git config --global user.email "woltlab@woltlab.com"
42 - name: Push the update
43 run: |
44 set -x
45 cd d.ts/
46 git add .
47
48 if git diff --cached --quiet; then
49 exit 0
50 fi
51
52 git commit -m "Update ${{ github.repository }} definitions
53
54 Generated using:
55
56 npx tsc --declaration --emitDeclarationOnly --outdir ./d.ts/
57
58 from ${{ github.repository }}@${{ steps.determine-commit.outputs.sha }}"
59 git push