feat(ci): windows build support
This commit is contained in:
parent
34dcc847c5
commit
9076c54b3f
1 changed files with 17 additions and 14 deletions
|
@ -26,20 +26,21 @@ jobs:
|
|||
cargo-tools-
|
||||
|
||||
- name: 🦀 Install Rust toolchain
|
||||
if: steps.cache-tools.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
components: rust-src
|
||||
override: true
|
||||
|
||||
- name: 📦 Install Zig and cargo-zigbuild
|
||||
- name: 📦 Install Build Tools
|
||||
if: steps.cache-tools.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p /tmp/zig
|
||||
cd /tmp/zig
|
||||
curl -Lo zig-linux-x86_64.tar.xz https://ziglang.org/builds/zig-linux-x86_64-0.15.0-dev.377+f01833e03.tar.xz
|
||||
tar -Jxf zig-linux-x86_64.tar.xz -C /tmp/zig --strip-components=1
|
||||
cargo install cargo-zigbuild
|
||||
cargo install cargo-zigbuild cargo-xwin --force
|
||||
|
||||
cargo-test:
|
||||
name: 🧪 Run Cargo Tests
|
||||
|
@ -68,7 +69,7 @@ jobs:
|
|||
components: rust-src
|
||||
override: true
|
||||
|
||||
- name: 🦀 Install Vulkan tools
|
||||
- name: 🌋 Install Vulkan tools
|
||||
run: |
|
||||
apt update
|
||||
apt install -y vulkan-tools glslc
|
||||
|
@ -90,17 +91,23 @@ jobs:
|
|||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- aarch64-unknown-linux-gnu
|
||||
# - x86_64-pc-windows-msvc
|
||||
- x86_64-pc-windows-msvc
|
||||
include:
|
||||
- target: x86_64-unknown-linux-gnu
|
||||
binary_name: zenyx-x86_64-linux
|
||||
ext: ""
|
||||
command: zigbuild
|
||||
args: --target x86_64-unknown-linux-gnu --release
|
||||
- target: aarch64-unknown-linux-gnu
|
||||
binary_name: zenyx-aarch64-linux
|
||||
ext: ""
|
||||
# - target: x86_64-pc-windows-msvc
|
||||
# binary_name: zenyx-x86_64-windows-msvc.exe
|
||||
# ext: ".exe"
|
||||
command: zigbuild
|
||||
args: --target aarch64-unknown-linux-gnu --release
|
||||
- target: x86_64-pc-windows-msvc
|
||||
binary_name: zenyx-x86_64-windows-msvc.exe
|
||||
ext: ".exe"
|
||||
command: xwin
|
||||
args: build --target x86_64-pc-windows-msvc --release
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout source
|
||||
|
@ -137,7 +144,7 @@ jobs:
|
|||
key: cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
cargo-
|
||||
- name: 🦀 Install Vulkan tools
|
||||
- name: 🌋 Install Vulkan tools
|
||||
run: |
|
||||
apt update
|
||||
apt install -y vulkan-tools glslc
|
||||
|
@ -145,17 +152,13 @@ jobs:
|
|||
- name: 🚀 Build release binary
|
||||
uses: https://github.com/actions-rs/cargo@v1
|
||||
with:
|
||||
command: zigbuild
|
||||
args: --target ${{ matrix.target }} --release
|
||||
command: ${{ matrix.command }}
|
||||
args: ${{ matrix.args }}
|
||||
|
||||
- name: 📦 Package artifact
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
|
||||
ls
|
||||
du -sh artifacts
|
||||
ls -lah artifacts
|
||||
ls -lah target/${{ matrix.target }}/release
|
||||
|
||||
- name: ⬆️ Upload artifact
|
||||
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue