Repository navigation
138 lines (108 loc) · 3.41 KB
/
Copy pathci.yml
File metadata and controls
138 lines (108 loc) · 3.41 KB
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
name: ci
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
check:
name: check
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: |
sudo apt-get update
sudo apt-get install -y clang libclang-dev cmake pkg-config
- run: cargo fmt --all -- --check
- run: cargo clippy --locked --all-targets --all-features -- -D warnings
- run: cargo test --locked --all-targets --all-features
- name: cli smoke
run: |
cargo run --locked --quiet -- --version
cargo run --locked --quiet -- --doctor || test $? -eq 1
cargo run --locked --quiet -- --help >/dev/null
msrv:
name: msrv (1.90)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.90.0"
- uses: Swatinem/rust-cache@v2
- run: |
sudo apt-get update
sudo apt-get install -y clang libclang-dev cmake pkg-config
- run: cargo check --locked --all-targets
release:
name: release (${{ matrix.target }})
needs: check
if: github.ref_type == 'tag'
runs-on: ${{ matrix.os }}
timeout-minutes: 45
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
binary: scribe
asset: scribe-linux-x86_64
- target: aarch64-apple-darwin
os: macos-latest
binary: scribe
asset: scribe-macos-aarch64
- target: x86_64-pc-windows-msvc
os: windows-latest
binary: scribe.exe
asset: scribe-windows-x86_64.exe
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang libclang-dev cmake pkg-config
- run: cargo build --locked --release --target ${{ matrix.target }}
- shell: bash
run: |
mkdir -p dist
cp "target/${{ matrix.target }}/release/${{ matrix.binary }}" "dist/${{ matrix.asset }}"
test -s "dist/${{ matrix.asset }}"
"target/${{ matrix.target }}/release/${{ matrix.binary }}" --version
- name: checksums
shell: bash
run: |
cd dist
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "${{ matrix.asset }}" > SHA256SUMS
else
shasum -a 256 "${{ matrix.asset }}" > SHA256SUMS
fi
# each target uploads its own binary. no generated notes, no body edits:
# three matrix jobs appending notes gave us three changelog links.
- uses: softprops/action-gh-release@v3
with:
files: dist/*
generate_release_notes: false
fail_on_unmatched_files: true