Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for building with debug configuration; add workflow to produce … #534

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Debug

on:
workflow_dispatch:
inputs:
version:
required: true
type: string
default: 2024.1.0
description: Release tag. Recommended format year.month.version

run-name: Debug ${{ inputs.version }}

permissions:
actions: read
contents: write

env:
artifact-name: Orbiter-${{ inputs.version }}.zip

jobs:
build:
name: Build
uses: ./.github/workflows/reusable-build.yml
strategy:
fail-fast: false
matrix:
architecture: [x64, x86]
with:
configuration: 'debug'
architecture: ${{ matrix.architecture }}
upload: true
docs: false

package:
name: Package
needs: [build]
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: Orbiter-x86
path: Orbiter-x86

- uses: actions/download-artifact@v4
with:
name: Orbiter-x64
path: Orbiter-x64

- run: |
find .
mv Orbiter-x86/Orbiter.zip Orbiter-x86-debug.zip
mv Orbiter-x64/Orbiter.zip Orbiter-x64-debug.zip

- name: "Create debug release"
uses: softprops/action-gh-release@v2
with:
body: "https://cdn.openorbiter.space/orbiter-releases/Orbiter-${{ inputs.version }}-debug.zip"
tag_name: ${{ inputs.version }}
prerelease: false
make_latest: true
target_commitish: ${{ github.sha }}
name: Orbiter ${{ inputs.version }}
files: |
Orbiter-x86-debug.zip
Orbiter-x64-debug.zip
32 changes: 18 additions & 14 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
os:
default: windows-2019
type: string
configuration:
description: 'Build configuration; release or debug'
default: release
type: string
architecture:
description: 'Build Architecture'
default: x86
Expand All @@ -29,17 +33,17 @@ jobs:
name: Build
runs-on: ${{ inputs.os }}
timeout-minutes: 60

env:
DXSDK_DIR: "${{ github.workspace }}\\DXSDK"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Problem Matcher
uses: ammaraskar/msvc-problem-matcher@master

- name: Setup MSVC Console
uses: ilammy/msvc-dev-cmd@v1
with:
Expand All @@ -57,7 +61,7 @@ jobs:
- name: Set up Miktex with appropriate packages
if: ${{ inputs.docs }}
shell: pwsh
run: |
run: |
miktex --admin --verbose packages update-package-database
miktex --admin --verbose packages update
miktex --admin --verbose packages install noto
Expand All @@ -69,13 +73,13 @@ jobs:
run: |
mkdir out\build
mkdir out\install

- name: Cache irrKlang package
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/Extern/irrKlang/${{ inputs.architecture }}
key: irrKlang-${{ inputs.architecture }}

- name: Cache DirectX SDK
id: cache
uses: actions/cache@v4
Expand All @@ -94,20 +98,20 @@ jobs:
dir /S /B DXSDK

- name: Configure
run: cmake . --preset windows-${{ inputs.architecture }}-release
-DORBITER_MAKE_DOC=${{ inputs.docs && 'ON' || 'OFF' }}
run: cmake . --preset windows-${{ inputs.architecture }}-${{ inputs.configuration }}
-DORBITER_MAKE_DOC=${{ inputs.docs && 'ON' || 'OFF' }}
-DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK"

- name: Build
run: cmake --build --preset windows-${{ inputs.architecture }}-release --jobs 2
run: cmake --build --preset windows-${{ inputs.architecture }}-${{ inputs.configuration }} --jobs 2

- name: Test
run: ctest --preset windows-${{ inputs.architecture }}-release --parallel 2
run: ctest --preset windows-${{ inputs.architecture }}-${{ inputs.configuration }} --parallel 2

- name: Install
working-directory: ${{ github.workspace }}/out/build/windows-${{ inputs.architecture }}-release
working-directory: ${{ github.workspace }}/out/build/windows-${{ inputs.architecture }}-${{ inputs.configuration }}
run: cmake --install . --prefix ${{ github.workspace }}/out/install

- name: List exports
shell: cmd
run: |
Expand Down Expand Up @@ -136,7 +140,7 @@ jobs:
name: exports-${{ inputs.architecture }}
path: ${{ github.workspace }}/exports.txt
retention-days: 1

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
if: inputs.upload
Expand Down
Loading