-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dextinfire
committed
Dec 26, 2024
1 parent
8625ab2
commit 5e2d5d8
Showing
5 changed files
with
104 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Docker Image CI for GHCR | ||
on: | ||
push: | ||
paths: | ||
- docker/impacto-switch/* | ||
|
||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/committeeofzero/impacto-switch | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
context: docker/impacto-switch | ||
file: docker/impacto-switch/Dockerfile | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,10 +72,6 @@ jobs: | |
os_name: macos-x64 | ||
triplet: x64-osx-ci | ||
host_triplet: x64-osx-ci | ||
- os: ubuntu-latest | ||
os_name: switch | ||
triplet: none | ||
host_triplet: none | ||
- os: ubuntu-latest | ||
os_name: android | ||
triplet: arm64-android-ci | ||
|
@@ -109,19 +105,8 @@ jobs: | |
distribution: "temurin" | ||
cache: 'gradle' | ||
|
||
- 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 }} | ||
|
||
- uses: lukka/get-cmake@latest | ||
- name: Setup vcpkg | ||
if: matrix.os_name != 'switch' | ||
uses: lukka/run-vcpkg@v11 | ||
id: runvcpkg | ||
with: | ||
|
@@ -136,7 +121,6 @@ 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' | ||
|
@@ -147,27 +131,6 @@ jobs: | |
'-DVCPKG_HOST_TRIPLET=${{ matrix.host_triplet }}', | ||
] | ||
buildPreset: ${{ env.PresetName }} | ||
- 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 -B switch-build -DCMAKE_TOOLCHAIN_FILE=HorizonNX.toolchain | ||
pushd switch-build | ||
make -j2 | ||
elf2nro impacto impacto.nro | ||
mkdir -p "${{ github.workspace }}/release/${{ env.PresetName }}" | ||
cp impacto.nro "${{ github.workspace }}/release/${{ env.PresetName }}" | ||
popd | ||
cp -r profiles "${{ github.workspace }}/release/${{ env.PresetName }}" | ||
cp -r games "${{ github.workspace }}/release/${{ env.PresetName }}" | ||
- name: "switch debug" | ||
if: always() && contains(matrix.os_name, 'switch') | ||
run: |- | ||
nm switch-build/_deps/libatrac9-build/libatrac9.a | ||
tree | ||
- name: Copy Shaders | ||
run: cp -r src/shaders "${{ github.workspace }}/release/${{ env.PresetName }}" | ||
shell: bash | ||
|
@@ -201,15 +164,58 @@ jobs: | |
path: impacto-${{ matrix.os_name }}-${{ vars.VERSION }}${{ github.run_number }}-${{ github.sha }}.zip | ||
name: release-${{ matrix.os_name }} | ||
|
||
|
||
switch: | ||
runs-on: | ||
timeout-minutes: 120 | ||
needs: lint | ||
permissions: | ||
contents: read | ||
packages: read | ||
container: | ||
image: ghcr.io/committeeofzero/impacto-switch:latest | ||
credentials: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ needs.lint.outputs.commitid }} | ||
- name: Run build | ||
run: |- | ||
cmake -B switch-build -DCMAKE_TOOLCHAIN_FILE=HorizonNX.toolchain | ||
pushd switch-build | ||
make -j2 | ||
elf2nro impacto impacto.nro | ||
mkdir -p "${{ github.workspace }}/release/ci-release" | ||
cp impacto.nro "${{ github.workspace }}/release/ci-release" | ||
popd | ||
cp -r profiles "${{ github.workspace }}/release/ci-release" | ||
cp -r games "${{ github.workspace }}/release/ci-release" | ||
- name: Copy Shaders | ||
run: cp -r src/shaders "${{ github.workspace }}/release/${{ env.PresetName }}" | ||
shell: bash | ||
- name: Copy docs | ||
run: | | ||
cp THIRDPARTY.md README.md LICENSE "${{ github.workspace }}/release/${{ env.PresetName }}" | ||
shell: bash | ||
- name: Archive Artifacts | ||
run: | | ||
7z u impacto-switch-${{ vars.VERSION }}${{ github.run_number }}-${{ github.sha }}.zip release/ci-release/* | ||
- name: Upload Artifact | ||
uses: actions/[email protected] | ||
with: | ||
path: impacto-switch-${{ vars.VERSION }}${{ github.run_number }}-${{ github.sha }}.zip | ||
name: release-switch | ||
|
||
publish_artifacts: | ||
name: Publish Artifacts | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
needs: | ||
- job-matrix | ||
if: needs.job-matrix.result == 'success' && github.event_name != 'pull_request_target' && ((startsWith(github.ref, 'refs/tags') || github.ref_name == 'master')) | ||
- switch | ||
if: needs.job-matrix.result == 'success' && needs.switch.result == 'success' && github.event_name != 'pull_request_target' && ((startsWith(github.ref, 'refs/tags') || github.ref_name == 'master')) | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM devkitpro/toolchain-base | ||
|
||
LABEL org.committeeofzero.impacto-switch https://github.com/committeeofzero/impacto | ||
|
||
RUN dkp-pacman -Syyu --noconfirm && \ | ||
dkp-pacman -S --needed --noconfirm switch-dev && \ | ||
dkp-pacman -S --needed --noconfirm switch-portlibs && \ | ||
dkp-pacman -S --needed --noconfirm switch-openal-soft && \ | ||
dkp-pacman -S --needed --noconfirm switch-webp && \ | ||
dkp-pacman -S --needed --noconfirm switch-sdl2 && \ | ||
dkp-pacman -S --needed --noconfirm switch-mesa && \ | ||
dkp-pacman -S --needed --noconfirm switch-ffmpeg && \ | ||
dkp-pacman -S --needed --noconfirm switch-libvorbis && \ | ||
yes | dkp-pacman -Scc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
"libogg", | ||
"libvorbis", | ||
"zlib", | ||
"glm", | ||
"avcpp", | ||
"libwebp" | ||
] | ||
|