Skip to content

Continous Delivery

Continous Delivery #5

Workflow file for this run

name: CI
on:
release:
types: [created]
permissions:
contents: write
env:
ZIG_VERSION: 0.13.0
jobs:
release:
name: Release - ${{ matrix.platform.release_for }}
strategy:
fail-fast: false
matrix:
platform:
- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
zig_target: x86_64-windows-msvc
rust_bin: create-docx.exe
zig_bin: pfcreator.exe
name: pfcreator-Windows-x86_64
command: build
- release_for: Windows-aarch64
os: windows-latest
target: aarch64-pc-windows-msvc
zig_target: aarch64-windows-msvc
rust_bin: create-docx.exe
zig_bin: pfcreator.exe
name: pfcreator-Windows-aarch64
command: build
- release_for: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
zig_target: aarch64-macos-none
rust_bin: create-docx
zig_bin: pfcreator
name: pfcreator-Darwin-aarch64
command: build
- release_for: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
zig_target: x86_64-linux-gnu
rust_bin: create-docx
zig_bin: pfcreator
name: pfcreator-Linux-x86_64
command: build
- release_for: Linux-aarch64-gnu
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
zig_target: aarch64-linux-gnu
rust_bin: create-docx
zig_bin: pfcreator
name: pfcreator-Linux-aarch64
command: build
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Build Zig Binary
run: |
zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.platform.zig_target }}
mkdir -p zig-bins
cp zig-out/bin/${{ matrix.platform.zig_bin }} zig-bins/zig-${{ matrix.platform.zig_bin }}
- name: Build Rust Binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
- name: Package and Upload
shell: bash
run: |
mkdir -p ${{ matrix.platform.name }}
# Copy Rust binary
cp target/${{ matrix.platform.target }}/release/${{ matrix.platform.rust_bin }} ${{ matrix.platform.name }}
# Copy Zig binary from our temporary location
cp zig-bins/zig-${{ matrix.platform.zig_bin }} ${{ matrix.platform.name }}
tar -czf ${{ matrix.platform.name }}.tar.gz ${{ matrix.platform.name }}
gh release upload ${{ github.event.release.tag_name }} ${{ matrix.platform.name }}.tar.gz
env:
GH_TOKEN: ${{ github.token }}