build #376
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: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- 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: check everything | |
run: |- | |
echo $PATH | |
find "$GITHUB_WORKSPACE/.msvc" | |
- name: Configure | |
if: false | |
run: >- | |
touch CMakePresets.json && CC=cl CXX=cl cmake -S src -B build -DCMAKE_SYSTEM_NAME=Windows -G"Ninja Multi-Config" | |
- name: Build | |
if: false | |
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}} |