diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4b4a6826..59cf816a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -5,11 +5,12 @@ on: branches: - main - main.fwd + - exp/action env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release - KERBAL_BRANCH: main.fwd + KERBAL_BRANCH: exp/action jobs: build: @@ -190,3 +191,51 @@ jobs: # # - name: Run Unit Test # run: cmake --build ${{github.workspace}}/KerbalTest-build --config ${{env.BUILD_TYPE}} --target runm_utest + + cpack: + continue-on-error: true + strategy: + matrix: + include: + - os: ubuntu-latest + cpack_generators: "DEB;STGZ;TGZ;ZIP;" + platform: "ubuntu" + - os: windows-latest + cpack_generators: "NuGet;NSIS;WIX;ZIP;" + platform: "windows" + - os: macos-latest + cpack_generators: "DragNDrop;ZIP;" + platform: "macos" + + runs-on: ${{matrix.os}} + needs: build + + steps: + - name: Show CPack Generators Support + run: cpack --help + + - name: Clone Kerbal + uses: actions/checkout@v4 + with: + repository: WentsingNee/Kerbal + ref: ${{env.KERBAL_BRANCH}} + path: Kerbal + submodules: 'true' + + - name: CPack Kerbal + run: > + cmake + -S ${{github.workspace}}/Kerbal/ + -B ${{github.workspace}}/Kerbal-pack/ + -DCMAKE_BUILD_TYPE=Release + -DCPACK_BUNDLE_NAME="Kerbal" + + cd ${{github.workspace}}/Kerbal-pack/ + + cpack -G "${{matrix.cpack_generators}}" + + - name: Upload Package + uses: actions/upload-artifact@v4 + with: + name: Kerbal-${{matrix.platform}} + path: ${{github.workspace}}/Kerbal-pack/packages