build #374
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
on: | |
pull_request: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
manualTrigger: | |
description: trigger a PR or release run | |
required: true | |
default: pr | |
type: choice | |
options: | |
- pr | |
- release | |
jobs: | |
compile: | |
if: > | |
(github.event_name == 'pull_request') || | |
(github.event_name == 'workflow_dispatch' && github.event.inputs.manualTrigger == 'pr') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install needed packages | |
run: >- | |
sudo apt-get update && | |
sudo apt-get install -y --no-install-recommends --no-install-suggests --no-upgrade | |
msitools libgcab-dev winbind ninja-build wine-stable git | |
- name: Cache msvc-wine | |
id: msvc-wine-cache | |
uses: actions/cache@v4 | |
with: | |
path: .msvc | |
key: msvc-wine-cache-key | |
- name: Download and install msvc-wine | |
if: steps.msvc-wine-cache.outputs.cache-hit != 'true' | |
run: |- | |
set -eux | |
git clone https://github.com/mstorsjo/msvc-wine.git | |
./msvc-wine/vsdownload.py --dest .msvc --accept-license --architecture x86 | |
./msvc-wine/install.sh .msvc | |
- name: Add msvc-wine to path | |
run: |- | |
set -eux | |
echo "$GITHUB_WORKSPACE/.msvc/bin/x86" >> "$GITHUB_PATH" | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Configure | |
run: >- | |
touch CMakePresets.json && CC=cl CXX=cl cmake -S . -B build -DCMAKE_SYSTEM_NAME=Windows -G"Ninja Multi-Config" | |
- name: Build | |
run: >- | |
cmake --build build -- -v | |
assemble: | |
if: > | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') == 'true') || | |
(github.event_name == 'workflow_dispatch' && github.event.inputs.manualTrigger == 'release') | |
needs: [ compile ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Test manual release | |
run: >- | |
echo ${{github.event.inputs.manualTrigger}} |