ci: build Windows binaries; add cross-platform CI test matrix
- release.yml: add x86_64-pc-windows-msvc target, OS-aware packaging (.exe + .zip) - ci.yml: split into lint (fmt/clippy) + test matrix (ubuntu/windows/macos) - use getrandom for the admin/key token CSPRNG (secure on Windows too)
This commit is contained in:
@@ -36,6 +36,8 @@ jobs:
|
||||
target: x86_64-unknown-linux-gnu
|
||||
- os: macos-14
|
||||
target: aarch64-apple-darwin
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
@@ -47,12 +49,19 @@ jobs:
|
||||
- name: Package
|
||||
shell: bash
|
||||
run: |
|
||||
bin=cortiq-gateway
|
||||
[ "${{ runner.os }}" = "Windows" ] && bin=cortiq-gateway.exe
|
||||
staging="cortiq-gateway-${{ github.ref_name }}-${{ matrix.target }}"
|
||||
mkdir "$staging"
|
||||
cp "target/${{ matrix.target }}/release/cortiq-gateway" "$staging"/
|
||||
cp "target/${{ matrix.target }}/release/$bin" "$staging"/
|
||||
cp README.md LICENSE config/gateway.example.toml "$staging"/
|
||||
tar czf "$staging.tar.gz" "$staging"
|
||||
echo "ASSET=$staging.tar.gz" >> "$GITHUB_ENV"
|
||||
if [ "${{ runner.os }}" = "Windows" ]; then
|
||||
7z a "$staging.zip" "$staging" >/dev/null
|
||||
echo "ASSET=$staging.zip" >> "$GITHUB_ENV"
|
||||
else
|
||||
tar czf "$staging.tar.gz" "$staging"
|
||||
echo "ASSET=$staging.tar.gz" >> "$GITHUB_ENV"
|
||||
fi
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user