-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (92 loc) · 2.74 KB
/
ci.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build and Release
on:
push:
branches: [main]
jobs:
build:
name: Build generator and definitions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: vendetta-mod/Vendetta
path: vendetta
- uses: actions/setup-node@v3
with:
node-version: 19
- name: Install treetype-ts
run: npm install --global treetype-ts
- name: Generate defs
run: |
mkdir build
ttgen -r @vendetta vendetta/src/def.d.ts VendettaObject /:plugin:VendettaPluginObject -o build/defs.d.ts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: sitereqs
path: build
publish:
name: Publish the type definitions
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v3
with:
name: sitereqs
path: build
- run: mv build/defs.d.ts npm_package
- name: Publish package
working-directory: npm_package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
build-site:
name: Build the TypeDoc site
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm i -g typescript typedoc
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: sitereqs
path: build
- name: Build the documentation
run: |
mv build/defs.d.ts npm_package
cd npm_package
npm i
cd ..
echo '{"compilerOptions":{"target":"esnext","moduleResolution":"node","allowSyntheticDefaultImports":true,"skipLibCheck":true}}' > tsconfig.json
typedoc npm_package/defs.d.ts
- run: tar --directory docs -hcf artifact.tar .
- uses: actions/upload-artifact@v3
with:
name: github-pages
path: ./artifact.tar
# Deploy the above artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
name: Deploy to Pages
runs-on: ubuntu-latest
needs: build-site
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v1