From 95b3755914dbb6bd03cdad8719675ab1d5b156a7 Mon Sep 17 00:00:00 2001 From: redshift0345 <20133568+redshift0345@users.noreply.github.com> Date: Sun, 5 May 2024 19:32:54 +0100 Subject: [PATCH] Add a release pipeline (#1) * add initial build workflow * change vs-version * change versions * add arch preference * remove versions There is only one version on the Actions hosted runner * change compiled config * using a .sln for compilation * add build flags * change build config * change build config * include underdered_map * change build config * add thread import * add matrix strategy for config targets * add matrix strategy for config targets * comment out builds for testing * add zipping and release steps * add quotes around vars * add needed for windows runner * remove extra $ * change runner attribute * change variable calls * change variable calls * add tag to release * change target archive path * change artifacts to archive * change target archive path * change release path * add dir list step * add dir list step * change release target * split release and build into two jobs * remove extentions for upload * use published tag in upload * remove tag * allow updating existing releases * add zip as an extention * remove zip as an extention from upload * change wildcard on release step * uncommend build targets --------- Co-authored-by: redshift0345 --- .github/workflows/main.yml | 58 ++++++++++++++++++++++++++++++++++ src/rendering/mesh_decoder.cpp | 1 + src/utils/timing.cpp | 2 ++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a9d95b4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,58 @@ +name: Deploy PengEngine + +on: + push: + tags: + - '**' +jobs: + build: + strategy: + matrix: + configuration: [Master, Release, Development, Debug] + os: [windows-latest] + + env: + binary_path: D:\a\PengEngine\PengEngine\\out\x64\${{ matrix.configuration }}\ + archive_name: '${{ github.event.repository.name }}-${{ matrix.configuration }}-${{ github.ref_name }}' + name: Build on windows + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + with: + msbuild-architecture: x64 + + - name: Build app for release + run: msbuild /p:configuration=${{ matrix.configuration }} /t:rebuild PengEngine.sln + + - name: Zip the project + uses: thedoctor0/zip-release@0.7.5 + with: + type: 'zip' + filename: "${{ env.archive_name }}.zip" + path: "${{ env.binary_path }}" + + - name: Cache artifacts + uses: actions/upload-artifact@v4 + with: + name: "${{ env.archive_name }}" + path: "*.zip" + overwrite: true + retention-days: 1 + + release: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + - name: Display structure of downloaded files + run: ls -R + + - name: Upload Release + uses: ncipollo/release-action@v1 + with: + artifacts: "*/*.zip" + token: ${{ secrets.API_TOKEN }} + allowUpdates: true \ No newline at end of file diff --git a/src/rendering/mesh_decoder.cpp b/src/rendering/mesh_decoder.cpp index d31964b..3904d11 100644 --- a/src/rendering/mesh_decoder.cpp +++ b/src/rendering/mesh_decoder.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include diff --git a/src/utils/timing.cpp b/src/utils/timing.cpp index 6731754..f0de7b4 100644 --- a/src/utils/timing.cpp +++ b/src/utils/timing.cpp @@ -1,3 +1,5 @@ +#include + #include "timing.h" namespace timing