-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (129 loc) · 3.8 KB
/
CD.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Release artifacts
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
publish-server:
if: startsWith(github.ref, 'refs/tags/')
name: Publish Server to RubyGems
runs-on: ubuntu-latest
defaults: { run: { working-directory: server } }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rubygems
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.4'
bundler-cache: true
working-directory: server
- name: Release server gem
uses: hybras/release-gem@v1
with:
working-directory: server
publish-client-go:
name: Check Go Client
runs-on: ubuntu-latest
defaults: { run: { working-directory: client-go } }
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
- name: Checkout
uses: actions/checkout@v4
- name: Build go client
run: |
go mod tidy
go mod vendor
go build
go install
# go test
lint-format-client-rs:
name: Lint and Format rust client
runs-on: ubuntu-latest
defaults:
run:
working-directory: client-rs
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: client-rs
- name: Install protobuf
uses: taiki-e/install-action@v2
with:
tool: protoc
- name: Lint
run: cargo clippy --no-deps --all-targets -- -D warnings
- name: Format
run: cargo fmt --check
build-client-rs:
name: Build rust client for ${{ matrix.job.target }} (on ${{ matrix.job.os }})
needs: [lint-format-client-rs]
runs-on: ${{ matrix.job.os }}
defaults: { run: { working-directory: client-rs } }
strategy:
fail-fast: false
matrix:
job:
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
on-pr: true
- target: aarch64-apple-darwin
os: macos-14
on-pr: true
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- target: arm-unknown-linux-musleabihf
os: ubuntu-latest
- target: i686-pc-windows-msvc
os: windows-2019
- target: i686-unknown-linux-gnu
os: ubuntu-latest
- target: i686-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-13
- target: x86_64-pc-windows-msvc
os: windows-2019
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
on-pr: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install protobuf,cargo-zigbuild,just
uses: taiki-e/install-action@v2
with:
tool: cargo-zigbuild, protoc,just
- name: Install zig
uses: mlugg/setup-zig@v1
- name: Install Rust toolchain
id: rust-toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: client-rs
key: os-${{ matrix.job.os }}-target-${{ matrix.job.target }}-rust-${{ steps.rust-toolchain.outputs.toolchain }}
- name: Upload rust binary
uses: taiki-e/upload-rust-binary-action@v1
with:
locked: true
bin: asciidoctor-client
target: ${{ matrix.job.target }}
token: ${{ secrets.GITHUB_TOKEN }}