diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 09ccc345..1d9912e4 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -29,7 +29,6 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest, macos-13] include: - os: windows-latest os_name: windows @@ -43,6 +42,9 @@ jobs: - os: macos-13 os_name: macos-x64 triplet: x64-osx-dynamic + - os: ubuntu-latest + os_name: switch + triplet: none env: VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} vcpkgCommitId: '0f88ecb8528605f91980b90a2c5bad88e3cb565f' @@ -50,7 +52,18 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Download Switch deps + if: matrix.os_name == 'switch' + uses: blauqs/actions-download-asset@master + with: + repo: MrRevo3D/impacto + version: buildtag + file: devkitpro.tgz + out: /opt + token: ${{ secrets.SWITCH_BUILD_TOKEN }} + - name: Cache LibAtrac9 + if: matrix.os_name != 'switch' uses: actions/cache@v3 with: key: libatrac9 | ${{ matrix.os_name }} @@ -58,6 +71,7 @@ jobs: - uses: lukka/get-cmake@latest - name: Setup vcpkg + if: matrix.os_name != 'switch' uses: lukka/run-vcpkg@v11 id: runvcpkg with: @@ -94,12 +108,28 @@ jobs: run: brew install nasm if: contains(matrix.os_name, 'macos') - name: Run CMake with vcpkg.json manifest + if: matrix.os_name != 'switch' uses: lukka/run-cmake@v10 with: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' configurePreset: ci-release configurePresetAdditionalArgs: "['-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}', '-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }}', '-DVCPKG_BUILD_TYPE=release']" buildPreset: CI-Build + + - name: Run Switch build + if: matrix.os_name == 'switch' + run: |- + tar -xzf /opt/devkitpro.tgz -C /opt + export DEVKITPRO=/opt/devkitpro + export DEVKITARM=/opt/devkitpro/devkitARM + export PATH="/opt/devkitpro/tools/bin:$PATH" + cmake . -DCMAKE_TOOLCHAIN_FILE=HorizonNX.toolchain + make -j2 + elf2nro impacto impacto.nro + mkdir -p "${{ github.workspace }}/release/ci-release" + cp impacto.nro "${{ github.workspace }}/release/ci-release" + cp -r profiles "${{ github.workspace }}/release/ci-release" + cp -r games "${{ github.workspace }}/release/ci-release" - name: Copy docs run: | @@ -143,23 +173,24 @@ jobs: id: date run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV - # - uses: tsickert/discord-webhook@v5.3.0 - # with: - # thread-id: ${{ secrets.discordChannelId }} - # webhook-url: ${{ secrets.discordWebhookKey }} - # username: IMPACTO - # avatar-url: https://cdn.discordapp.com/emojis/766988033127481344.png - # embed-title : "${{ github.event.commits[0].author.name }}" - # embed-color: 3659647 - # embed-timestamp: ${{ env.NOW }} - # embed-description: > - # "Commit\n - # `${{ github.event.head_commit.message }} (${{ github.sha }})`\n - # from branch `${{ env.BRANCH_NAME }}` has been successfully built.\n\n - # Release URL:\n - # https://github.com/CommitteeOfZero/impacto/releases/tag/${{ needs.get_version.outputs.version }}\n\n - # Details:\n - # ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + - uses: tsickert/discord-webhook@v5.3.0 + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} + username: IMPACTO + avatar-url: https://cdn.discordapp.com/emojis/766988033127481344.png + embed-title : "${{ github.event.commits[0].author.name }}" + embed-color: 3659647 + embed-timestamp: ${{ env.NOW }} + embed-description: | + Commit + `${{ github.event.head_commit.message }} (${{ github.sha }})` + from branch `${{ env.BRANCH_NAME }}` has been successfully built. + + Release URL: + https://github.com/CommitteeOfZero/impacto/releases/tag/${{ needs.get_version.outputs.version }} + + Details: + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} notify_fail: name: Notify failure runs-on: ubuntu-22.04 @@ -175,7 +206,11 @@ jobs: json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \ "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs") - name_conclusion_array=($(echo "$json_data" | jq -r '.jobs[] | select(.name | startswith("job-matrix")) | "\(.name).\(.conclusion)"')) + + name_conclusion_array=($(echo "$json_data" | jq -r ' + .jobs[] | + select(.name | IN("macos-arm64", "linux", "windows", "switch", "macos-x64")) | + "\(.name).\(.conclusion)"')) for item in "${name_conclusion_array[@]}"; do IFS='.' read -r name conclusion <<< "$item" @@ -186,21 +221,25 @@ jobs: id: date run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT - # - uses: tsickert/discord-webhook@v5.3.0 - # with: - # thread-id: ${{ secrets.discordChannelId }} - # webhook-url: ${{ secrets.discordWebhookKey }} - # username: IMPACTO - # avatar-url: https://cdn.discordapp.com/emojis/766988033127481344.png - # embed-title : "${{ github.event.commits[0].author.name }}" - # embed-color: 16711680 - # embed-timestamp: ${{ steps.date.outputs.NOW }} - # embed-description: > - # "Commit\n - # `${{ github.event.head_commit.message }} (${{ github.sha }})`\n - # from branch `${{ env.BRANCH_NAME }}` has failed build.\n\n - # Job status:\n - - # ${{join(steps.get_jobs_status.outputs.*, '\n')}}\n\n - # Details:\n - # ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ No newline at end of file + - uses: tsickert/discord-webhook@v5.3.0 + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} + username: IMPACTO + avatar-url: https://cdn.discordapp.com/emojis/766988033127481344.png + embed-title : "${{ github.event.commits[0].author.name }}" + embed-color: 16711680 + embed-timestamp: ${{ steps.date.outputs.NOW }} + embed-description: | + Commit + `${{ github.event.head_commit.message }} (${{ github.sha }})` + from branch `${{ env.BRANCH_NAME }}` has failed build. + + Job status: + windows: ${{steps.get_jobs_status.outputs.windows}} + linux: ${{steps.get_jobs_status.outputs.linux}} + macos-arm64: ${{steps.get_jobs_status.outputs.macos-arm64}} + macos-x64: ${{steps.get_jobs_status.outputs.macos-x64}} + switch: ${{steps.get_jobs_status.outputs.switch}} + + Details: + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.gitignore b/.gitignore index 58e94577..00445513 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ bld/ [Ii]nstall/ cmake-build-*/ impacto-build/ +ci-build/ # Visual Studio 2015 cache/options directory .vs/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 649ad696..ae62572b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1058,15 +1058,7 @@ target_include_directories(impacto PRIVATE ${PROJECT_BINARY_DIR}/include) install(TARGETS impacto RUNTIME DESTINATION .) if (WIN32) - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ - DESTINATION . - FILES_MATCHING PATTERN "*.dll" - PATTERN ".cmake" EXCLUDE - PATTERN "CMakeFiles" EXCLUDE - PATTERN "include" EXCLUDE - PATTERN "Testing" EXCLUDE - PATTERN "_deps" EXCLUDE - ) + x_vcpkg_install_local_dependencies(TARGETS impacto DESTINATION .) install(FILES ${LIBATRAC9_INCLUDE_DIR}/../bin/${LIBATRAC9_ARCH}/libatrac9.dll DESTINATION .) endif () diff --git a/CMakePresets.json b/CMakePresets.json index 600b299f..2f5c3d24 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -6,15 +6,37 @@ }, "configurePresets": [ { - "name": "ninja-multi-default", - "description": "Multi-Config Ninja Configure Preset", - "hidden": false, - "generator": "Ninja Multi-Config", + "name": "Base", + "description": "Default Base Configuration", + "hidden": true, + "generator": "Ninja", "binaryDir": "impacto-build/${presetName}", "installDir": "install/${presetName}", "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", "cacheVariables": { - "CMAKE_EXPORT_COMPILE_COMMANDS": "YES" + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "Release", + "description": "Default Release Build", + "hidden": false, + "inherits": [ + "Base" + ], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "Debug", + "description": "Default Debug Build", + "hidden": false, + "inherits": [ + "Base" + ], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" } }, { @@ -39,20 +61,10 @@ "install" ] }, - { - "name": "x64-Release-Symbols", - "description": "x64 Release with Debug Symbols", - "configurePreset": "ninja-multi-default", - "configuration": "RelWithDebInfo", - "targets": [ - "install" - ] - }, { "name": "x64-Release", - "description": "x64 Release", - "configurePreset": "ninja-multi-default", - "configuration": "Release", + "description": "x64 Release with Debug Symbols", + "configurePreset": "Release", "targets": [ "install" ] @@ -60,8 +72,7 @@ { "name": "x64-Debug", "description": "x64 Debug", - "configurePreset": "ninja-multi-default", - "configuration": "Debug", + "configurePreset": "Debug", "targets": [ "install" ]