Skip to content

Commit a7840e9

Browse files
committed
🔨 workflow追加
1 parent e8c6abb commit a7840e9

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/generate.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Generate .d.ts
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write # リポジトリのコンテンツに書き込み権限を与える
10+
11+
jobs:
12+
generate-dts:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: リポジトリをチェックアウト
17+
uses: actions/checkout@v4
18+
19+
- name: Node.js をセットアップ
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "18"
23+
24+
- name: TypeScript をインストール
25+
run: npm install --save-dev typescript
26+
27+
- name: tsconfig.json を作成
28+
run: |
29+
echo '{
30+
"compilerOptions": {
31+
"allowJs": true,
32+
"declaration": true,
33+
"emitDeclarationOnly": true,
34+
"outDir": "types"
35+
},
36+
"include": ["dist/*.js"]
37+
}' > tsconfig.json
38+
39+
- name: .d.ts を生成
40+
run: npx tsc
41+
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
if-no-files-found: error
45+
path: types/*
46+
47+
- name: Upload .d.ts to existing release
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
files: types/*.d.ts # .d.tsファイルをアップロード
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)