Skip to content

fix(ci): invoking UEFI loader only on release build #80

fix(ci): invoking UEFI loader only on release build

fix(ci): invoking UEFI loader only on release build #80

Workflow file for this run

name: Rust
on:
push:
branches: ['master', 'release']
env:
CARGO_TERM_COLOR: always
jobs:
check-fmt:
runs-on: windows-latest
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-09-25
target: x86_64-unknown-uefi
components: rustfmt
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Check fmt
run: cargo fmt --check
build-standalone:
runs-on: windows-latest
needs: check-fmt
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-09-25
target: x86_64-unknown-uefi
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get package version
shell: bash
run: |
VERSION=$(cargo pkgid --manifest-path driver-standalone/Cargo.toml | cut -d# -f2 | cut -d: -f2 | cut -d@ -f2)
echo "Package version: $VERSION"
echo "ARTIFACT_VERSION=$VERSION" >> "$GITHUB_ENV"
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
- name: Build Driver
run: ./.github/workflows/build-driver.ps1
- name: Upload release build to portal
shell: bash
run: .github/workflows/artifact_upload.sh kernel-driver target/x86_64-pc-windows-msvc/release/valthrun-driver.sys target/x86_64-pc-windows-msvc/release/driver_standalone.pdb
if: ${{ github.event_name != 'pull_request' }}
env:
ARTIFACT_API_KEY: ${{ secrets.ARTIFACT_API_KEY }}
build-uefi:
runs-on: windows-latest
needs: check-fmt
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-09-25
target: x86_64-unknown-uefi
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
- name: Build UEFI Driver
run: ./.github/workflows/build-driver-uefi.ps1
- uses: actions/upload-artifact@v4
id: uefi-driver-upload
with:
name: valthrun-driver-uefi
path: |
target/x86_64-pc-windows-msvc/release/driver_uefi.dll
target/x86_64-pc-windows-msvc/release/driver_uefi.pdb
- name: Trigger ISO build
env:
UEFI_MAPPER_GITHUB_TOKEN: ${{ secrets.UEFI_MAPPER_GITHUB_TOKEN }}
DRIVER_GITHUB_TOKEN: ${{ secrets.DRIVER_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
DRIVER_ARTIFACT_ID: ${{ steps.uefi-driver-upload.outputs.artifact-id }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF_NAME: ${{ github.ref_name || 'unknown' }}
if: ${{ github.ref == 'ref/head/release' }}
run: ./.github/workflows/invoke-mapper.ps1
build-driver-interface:
runs-on: windows-latest
needs: [check-fmt]
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get package version
shell: bash
run: |
VERSION=$(cargo pkgid --manifest-path driver-interface/Cargo.toml | cut -d# -f2 | cut -d: -f2 | cut -d"@" -f2)
echo "Package version: $VERSION"
echo "ARTIFACT_VERSION=$VERSION" >> "$GITHUB_ENV"
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-all-crates: true
- name: Build Kernel Driver interface
run: cargo b -r -v --lib --manifest-path driver-interface/Cargo.toml
- name: Upload artifact to portal
shell: bash
run: .github/workflows/artifact_upload.sh driver-interface-kernel target/release/driver_interface_kernel.dll target/release/driver_interface_kernel.pdb
if: ${{ github.event_name != 'pull_request' }}
env:
ARTIFACT_API_KEY: ${{ secrets.ARTIFACT_API_KEY }}