-
Notifications
You must be signed in to change notification settings - Fork 6
150 lines (144 loc) · 5.54 KB
/
cid.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: CI/CD
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cargo Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build project
run: cargo build --workspace --release
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
run: rustup component add rustfmt clippy
- name: Cargo Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Run tests
run: cargo test --workspace
deploy_release:
needs: [ build, test ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish release
run: |
cargo publish --package clipboard-history-core
cargo publish --package clipboard-history-client-sdk
cargo publish --package clipboard-history-server
cargo publish --package clipboard-history
cargo publish --package clipboard-history-x11
cargo publish --package wayland-interface-check
cargo publish --package clipboard-history-egui
cargo publish --package clipboard-history-tui
sed -i 's/name = "clipboard-history-server"/name = "ringboard-server"/' server/Cargo.toml
cargo publish --package ringboard-server --allow-dirty
sed -i 's/name = "clipboard-history"/name = "ringboard"/' cli/Cargo.toml
cargo publish --package ringboard --allow-dirty
sed -i 's/name = "clipboard-history-x11"/name = "ringboard-x11"/' x11/Cargo.toml
cargo publish --package ringboard-x11 --allow-dirty
sed -i 's/name = "clipboard-history-egui"/name = "ringboard-egui"/' egui/Cargo.toml
cargo publish --package ringboard-egui --allow-dirty
sed -i 's/name = "clipboard-history-tui"/name = "ringboard-tui"/' tui/Cargo.toml
cargo publish --package ringboard-tui --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
attach_binaries:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
tool: cargo
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
tool: cargo
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
tool: RUSTFLAGS="-Ctarget-feature=-outline-atomics" cross
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
tool: cross
needs: [ build, test ]
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
run: |
rustup target add ${{ matrix.target }}
rustup component add rust-src
- name: Install cross
if: contains(matrix.tool, 'cross')
run: cargo install cross
- name: Build binary
run: ${{ matrix.tool }} build --workspace --release --locked --target=${{ matrix.target }} -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/ringboard-server
asset_name: ${{ matrix.target }}-ringboard-server
tag: ${{ github.ref }}
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/ringboard
asset_name: ${{ matrix.target }}-ringboard
tag: ${{ github.ref }}
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/ringboard-x11
asset_name: ${{ matrix.target }}-ringboard-x11
tag: ${{ github.ref }}
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/wayland-interface-check
asset_name: ${{ matrix.target }}-wayland-interface-check
tag: ${{ github.ref }}
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/ringboard-egui
asset_name: ${{ matrix.target }}-ringboard-egui
tag: ${{ github.ref }}
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/ringboard-tui
asset_name: ${{ matrix.target }}-ringboard-tui
tag: ${{ github.ref }}