-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (73 loc) · 2.71 KB
/
update-types.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
name: Update Types
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
update_types:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.34
- name: Clone TBA Schema parser repo
run: git clone https://github.com/ENCRYPTEDFOREVER/tg-bot-api.git
# - name: Temporal dirty fix for https://github.com/ark0f/tg-bot-api/issues/20
# run: bun dirty-fix
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Use cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
tg-bot-api/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
${{ runner.os }}-
- name: Generate TBA Schema
run: cd tg-bot-api && cargo run --package gh-pages-generator --bin gh-pages-generator -- dev
- id: cicd
name: Get hash from schema
run: bun cicd
- name: Generate types
run: bun generate
- name: Prepare to JSR publish
run: bun jsr
- name: Commit and Push changes
uses: EndBug/add-and-commit@v9
with:
message: "release v${{ steps.cicd.outputs.version }}"
- id: changelog
name: Generate changelog
run: bun scripts/generate-changelog.ts
- name: Publish package to JSR
run: bunx jsr publish
- name: Publish package to NPM
run: bun publish --access public
env:
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: GitHub Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ steps.cicd.outputs.version }}
name: v${{ steps.cicd.outputs.version }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
generateReleaseNotes: true