From 41aa45057ae29496f8a424075c0a345c09edd712 Mon Sep 17 00:00:00 2001 From: Xyon Date: Wed, 1 Jan 2025 10:53:07 +0000 Subject: [PATCH] Allow for building with debug configuration; add workflow to produce debug build (#534) --- .github/workflows/debug.yml | 69 ++++++++++++++++++++++++++++ .github/workflows/reusable-build.yml | 32 +++++++------ 2 files changed, 87 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/debug.yml diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml new file mode 100644 index 000000000..c95c7f541 --- /dev/null +++ b/.github/workflows/debug.yml @@ -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 diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 8f2fb097d..5fd5926d7 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -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 @@ -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: @@ -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 @@ -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 @@ -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: | @@ -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