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
name: Release
on:
push:
tags:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-24.04
archive: tar.gz
# x86_64-apple-darwin dropped: ort-sys has no prebuilt binaries for Intel Mac
# Intel Mac users can build from source: cargo install cqs
- target: aarch64-apple-darwin
runner: macos-latest
archive: tar.gz
- target: x86_64-pc-windows-msvc
runner: windows-latest
archive: zip
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Package archive
shell: bash
run: |
VERSION="${GITHUB_REF_NAME}"
STAGING="cqs-${VERSION}-${{ matrix.target }}"
mkdir -p "${STAGING}"
if [ "${{ matrix.runner }}" = "windows-latest" ]; then
cp "target/${{ matrix.target }}/release/cqs.exe" "${STAGING}/cqs.exe"
else
cp "target/${{ matrix.target }}/release/cqs" "${STAGING}/cqs"
fi
for f in README.md LICENSE; do
[ -f "$f" ] && cp "$f" "${STAGING}/"
done
ARCHIVE="cqs-${VERSION}-${{ matrix.target }}.${{ matrix.archive }}"
if [ "${{ matrix.archive }}" = "zip" ]; then
7z a "${ARCHIVE}" "${STAGING}"
else
tar czf "${ARCHIVE}" "${STAGING}"
fi
echo "ARCHIVE=${ARCHIVE}" >> "$GITHUB_ENV"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cqs-${{ matrix.target }}
path: ${{ env.ARCHIVE }}
if-no-files-found: error
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: cqs-*
merge-multiple: true
path: artifacts
- name: Generate checksums
working-directory: artifacts
run: |
VERSION="${GITHUB_REF_NAME}"
sha256sum cqs-${VERSION}-* > "cqs-${VERSION}-checksums-sha256.txt"
echo "## SHA256 Checksums"
cat "cqs-${VERSION}-checksums-sha256.txt"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
files: artifacts/*