Skip to content

Commit

Permalink
Test discord hook
Browse files Browse the repository at this point in the history
Test discord hook
Test discord hook
Fix discord webhook
[ci skip] only master releases
[ci skip] Update CMakePresets

Test Switch build
Update pipeline.yml
Update
Update pipeline.yml
Update pipeline.yml
Update pipeline.yml
Clean up

Update pipeline.yml
Update pipeline.yml
Update pipeline.yml
Update pipeline.yml
Update pipeline.yml
Update pipeline.yml
discordo

discordo
  • Loading branch information
MrRevo3D committed Sep 9, 2024
1 parent 85e64c7 commit a923373
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 65 deletions.
113 changes: 76 additions & 37 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,21 +42,36 @@ 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'

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 }}
path: vendor/LibAtrac9

- uses: lukka/get-cmake@latest
- name: Setup vcpkg
if: matrix.os_name != 'switch'
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -143,23 +173,24 @@ jobs:
id: date
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV

# - uses: tsickert/[email protected]
# 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/[email protected]
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
Expand All @@ -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"
Expand All @@ -186,21 +221,25 @@ jobs:
id: date
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT

# - uses: tsickert/[email protected]
# 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 }}"
- uses: tsickert/[email protected]
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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bld/
[Ii]nstall/
cmake-build-*/
impacto-build/
ci-build/

# Visual Studio 2015 cache/options directory
.vs/
Expand Down
10 changes: 1 addition & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand Down
49 changes: 30 additions & 19 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand All @@ -39,29 +61,18 @@
"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"
]
},
{
"name": "x64-Debug",
"description": "x64 Debug",
"configurePreset": "ninja-multi-default",
"configuration": "Debug",
"configurePreset": "Debug",
"targets": [
"install"
]
Expand Down

0 comments on commit a923373

Please sign in to comment.