-
Notifications
You must be signed in to change notification settings - Fork 119
74 lines (69 loc) · 2.01 KB
/
publish.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
name: Publish to Cargo & JSR
on:
push:
# tags:
# - "**"
permissions: write-all
jobs:
codegen:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: debug
run: echo $GITHUB_REF && ls -la && pwd
- name: Set Package Versions to current tag
run: sed -i "s/__PACKAGE_VERSION__/$(echo $GITHUB_REF | cut -d '/' -f 3)/g" packages/ts/deno.json \
&& sed -i "s/__PACKAGE_VERSION__/$(echo $GITHUB_REF | cut -d '/' -f 3)/g" packages/rust/Cargo.toml
- name: Setup Buf
uses: bufbuild/buf-setup-action@main
with:
github_token: ${{ github.token }}
- name: Generate code
run: buf generate dewars
- name: Copy license
run: cp LICENSE packages/ts && cp LICENSE packages/rust
- name: Upload Rust code
uses: actions/upload-artifact@v4
with:
name: rust_code
path: packages/rust
- name: Upload TypeScript code
uses: actions/upload-artifact@v4
with:
name: ts_code
path: packages/ts
publish-jsr:
runs-on: ubuntu-24.04
needs: codegen
permissions:
contents: read
id-token: write
steps:
- name: Download TypeScript code
uses: actions/download-artifact@v4
with:
name: ts_code
- name: Set up Deno
uses: denoland/setup-deno@main
with:
deno-version: rc
- name: Publish to JSR
run: deno publish --unstable-sloppy-imports
publish-cargo:
runs-on: ubuntu-24.04
needs: codegen
steps:
- name: Download Rust code
uses: actions/download-artifact@v4
with:
name: rust_code
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Check Library
run: cargo check
- name: Publish to crates.io
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_TOKEN }}
ignore-unpublished-changes: true