Use sptr until strict provenance is stable #655
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_dispatch: | |
inputs: | |
latest: | |
description: 'Update latest release' | |
required: true | |
default: false | |
type: boolean | |
overwrite: | |
description: 'Overwrite file on upload' | |
required: true | |
default: false | |
type: boolean | |
prerelease: | |
description: 'Update PreRelease' | |
required: true | |
default: false | |
type: boolean | |
release: | |
description: 'Release' | |
required: true | |
default: false | |
type: boolean | |
release_mode: | |
description: 'Release Mode' | |
required: true | |
default: false | |
type: boolean | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
release: | |
types: [created] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
permissions: write-all | |
runs-on: windows-2022 | |
steps: | |
# attempt to increase windows runner speed | |
# https://github.com/actions/runner-images/issues/7320#issuecomment-1477640384 | |
- run: Set-MpPreference -DisableRealtimeMonitoring $true | |
shell: powershell | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install just | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: just | |
- name: Install cargo-target-dir | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: cargo-target-dir | |
git: https://github.com/MolotovCherry/cargo-target-dir | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ (github.event_name == 'release' || inputs.release_mode || inputs.release) && 'prod' || 'dev' }} | |
- name: Build Release | |
if: github.event_name == 'release' || inputs.release_mode || inputs.release | |
run: just build-release | |
- name: Build Debug | |
if: github.event_name != 'release' && !(inputs.release_mode || inputs.release) | |
env: | |
CARGO_INCREMENTAL: 1 | |
run: just build-ci | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: | | |
target/*/*.exe | |
target/*/*.dll | |
target/*/*.pdb | |
- name: Create staging folders | |
if: github.event_name == 'release' || inputs.release | |
run: | | |
New-Item -ItemType Directory -Force -Path bin | |
New-Item -ItemType Directory -Force -Path debug | |
- name: Zip files up | |
if: github.event_name == 'release' || inputs.release | |
run: | | |
# release assets | |
Get-ChildItem -Path target/*/*.exe,target/*/deps/artifact/loader-*/cdylib/*.dll,assets/* | Copy-Item -Destination "bin" | |
Compress-Archive -Path "bin" -CompressionLevel Optimal -DestinationPath "yet-another-bg3-native-mod-loader-x64.zip" | |
Get-ChildItem -Path "bin" -Recurse | Remove-Item -Force | |
# debug symbols | |
Get-ChildItem -Path target/*/*.pdb,assets-dbg/* | Copy-Item -Destination "debug" | |
$files = Get-ChildItem -Path debug/* | |
Compress-Archive -CompressionLevel Optimal -Path $files.FullName -DestinationPath "yet-another-bg3-native-mod-loader-dbg-symbols-x64.zip" | |
Get-ChildItem -Path "debug" -Recurse | Remove-Item -Force | |
- name: Attach assets to release | |
if: github.event_name == 'release' || inputs.release | |
uses: xresloader/upload-to-github-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
file: "*.zip" | |
draft: false | |
update_latest_release: ${{ inputs.latest }} | |
overwrite: ${{ inputs.overwrite }} | |
prerelease: ${{ inputs.prerelease }} | |
release_id: ${{ github.event_name == 'release' && github.event.release.id || 0 }} |