Skip to content

Commit

Permalink
Update test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
glKarin authored Nov 7, 2024
1 parent b70a7e3 commit c746afb
Showing 1 changed file with 47 additions and 50 deletions.
97 changes: 47 additions & 50 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Only for building testing version by Github CI workflow
# Only for building testing version on Windows/Linux by Github CI workflow

name: Test
name: Windows/Linux testing build

on:
push:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
echo ${{ github.workspace }} ${{ matrix.os }}-${{ matrix.bits }}
if [ "x${{ matrix.bits }}" = "x32" ]; then echo "arch=86" >> "$GITHUB_OUTPUT"; else echo "arch=64" >> "$GITHUB_OUTPUT"; fi
if [ "x${{ matrix.os }}" = "xubuntu-latest" ]; then echo "os=linux" >> "$GITHUB_OUTPUT"; echo "archive=tar.gz" >> "$GITHUB_OUTPUT"; else echo "os=win" >> "$GITHUB_OUTPUT"; echo "archive=zip" >> "$GITHUB_OUTPUT"; fi
if [ "x${{ matrix.os }}" = "xubuntu-latest" ]; then echo "os=linux" >> "$GITHUB_OUTPUT"; echo "archive=tar.gz" >> "$GITHUB_OUTPUT"; if [ "x${{ matrix.bits }}" = "x32" ]; then echo "name=linux_i386" >> "$GITHUB_OUTPUT"; else echo "name=linux_amd64" >> "$GITHUB_OUTPUT"; fi else echo "os=win" >> "$GITHUB_OUTPUT"; echo "archive=zip" >> "$GITHUB_OUTPUT"; if [ "x${{ matrix.bits }}" = "x32" ]; then echo "name=win_x86" >> "$GITHUB_OUTPUT"; else echo "name=win_x64" >> "$GITHUB_OUTPUT"; fi fi
- name: Get current date time
id: current_datetime
Expand All @@ -81,77 +81,68 @@ jobs:
token: ${{ secrets.TOKEN }}
github-binarycache: true

- name: Configure project with CMake
- name: Configure project with CMake(Windows)
if: matrix.os == 'windows-latest'
run: |
cd Q3E\src\main\jni\doom3\neo
cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -B ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_D3_MOD=ON -DBUILD_Q4=ON -DBUILD_PREY=ON -DBUILD_Q4_MOD=ON -A ${{ matrix.bits == 32 && 'Win32' || 'x64' }} CMakeLists.txt
cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -B ${{ steps.strings.outputs.name }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_D3_MOD=OFF -DBUILD_Q4=OFF -DBUILD_PREY=OFF -DBUILD_Q4_MOD=OFF -A ${{ matrix.bits == 32 && 'Win32' || 'x64' }} CMakeLists.txt
- name: Build with Ninja
if: matrix.os == 'windows-latest'
- name: Run apt
if: matrix.os == 'ubuntu-latest'
run: |
cd Q3E\src\main\jni\doom3\neo
dir ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}
cmake --build ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }} --config Release
sudo dpkg --add-architecture i386
sudo apt install -y gcc-multilib g++-multilib libsdl2-dev libopenal-dev # zlib1g-dev # libcurl4-openssl-dev
- name: Configure project with CMake(Linux)
if: matrix.os == 'ubuntu-latest'
run: |
cd Q3E/src/main/jni/doom3/neo
cmake -B ${{ steps.strings.outputs.name }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_SHARED_LINKER_FLAGS=-m${{ matrix.bits }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DUSE_MINIZ=ON -DBUILD_D3_MOD=OFF -DBUILD_Q4=OFF -DBUILD_PREY=OFF -DBUILD_Q4_MOD=OFF CMakeLists.txt
- name: Build with Make/Ninja
run: |
cd Q3E/src/main/jni/doom3/neo
ls ${{ steps.strings.outputs.name }}
cmake --build ${{ steps.strings.outputs.name }} --config ${{ matrix.build_type }}
- name: Copy OpenAL32.dll
if: matrix.os == 'windows-latest'
run: |
xcopy /Y/Q ${{ github.workspace }}\vcpkg\packages\openal-soft_x${{ steps.strings.outputs.arch }}-windows\bin\OpenAL32.dll Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}\Release\
xcopy /Y/Q ${{ github.workspace }}\vcpkg\packages\openal-soft_x${{ steps.strings.outputs.arch }}-windows\bin\OpenAL32.dll Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.name }}\${{ matrix.build_type }}\
- name: Prepare package
if: matrix.os == 'windows-latest'
run: |
dir Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}\Release
mkdir Release
xcopy /Y/Q Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}\Release\*.dll ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release\
xcopy /Y/Q Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}\Release\*.exe ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release\
dir ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release
dir Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.name }}\${{ matrix.build_type }}
mkdir ${{ matrix.build_type }}
xcopy /Y/Q Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.name }}\${{ matrix.build_type }}\*.dll ${{ steps.strings.outputs.name }}_${{ matrix.build_type }}\
xcopy /Y/Q Q3E\src\main\jni\doom3\neo\${{ steps.strings.outputs.name }}\${{ matrix.build_type }}\*.exe ${{ steps.strings.outputs.name }}_${{ matrix.build_type }}\
dir ${{ steps.strings.outputs.name }}_${{ matrix.build_type }}
- name: Package to zip
if: matrix.os == 'windows-latest'
uses: vimtor/[email protected]
with:
files: ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release/
dest: idTech4A++-testing_${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}-${{ steps.current_datetime.outputs.time }}.zip
files: ${{ steps.strings.outputs.name }}_${{ matrix.build_type }}/
dest: idTech4A++-testing_${{ steps.strings.outputs.name }}-${{ steps.current_datetime.outputs.time }}.zip
recursive: false

- name: run apt
if: matrix.os == 'ubuntu-latest'
run: |
sudo dpkg --add-architecture i386
sudo apt install -y gcc-multilib g++-multilib libsdl2-dev libopenal-dev zlib1g-dev libcurl4-openssl-dev
- name: Configure CMake Linux
if: matrix.os == 'ubuntu-latest'
run: |
cd Q3E/src/main/jni/doom3/neo
cmake -B ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_SHARED_LINKER_FLAGS=-m${{ matrix.bits }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_D3_MOD=ON -DBUILD_Q4=ON -DBUILD_PREY=ON -DBUILD_Q4_MOD=ON CMakeLists.txt
- name: Build with make
if: matrix.os == 'ubuntu-latest'
run: |
cd Q3E/src/main/jni/doom3/neo
ls ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}
cmake --build ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }} --config Release
- name: Package to tgz
if: matrix.os == 'ubuntu-latest'
run: |
ls --color Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}
mkdir ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}/lib*.so ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release/
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}/Doom3 ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release/
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}/Quake4 ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release/
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}/Prey ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release/
dir ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release
tar zcvf idTech4A++-testing_${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}-${{ steps.current_datetime.outputs.time }}.tar.gz ${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}_release/
ls --color Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.name }}
mkdir ${{ steps.strings.outputs.name }}_${{ matrix.build_type }}
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.name }}/lib*.so ${{ steps.strings.outputs.name }}_${{ matrix.build_type }} || true/
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.name }}/Doom3 ${{ steps.strings.outputs.name }}_${{ matrix.build_type }} || true/
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.name }}/Quake4 ${{ steps.strings.outputs.name }}_${{ matrix.build_type }} || true/
cp Q3E/src/main/jni/doom3/neo/${{ steps.strings.outputs.name }}/Prey ${{ steps.strings.outputs.name }}_${{ matrix.build_type }} || true/
tar zcvf idTech4A++-testing_${{ steps.strings.outputs.name }}-${{ steps.current_datetime.outputs.time }}.tar.gz ${{ steps.strings.outputs.name }}_${{ matrix.build_type }}/
- uses: actions/upload-artifact@v4
name: Upload package archive artifacts
with:
name: "${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}-release"
path: "idTech4A++-testing_${{ steps.strings.outputs.os }}_x${{ steps.strings.outputs.arch }}-${{ steps.current_datetime.outputs.time }}.${{ steps.strings.outputs.archive }}"
name: "${{ steps.strings.outputs.name }}-${{ matrix.build_type }}"
path: "idTech4A++-testing_${{ steps.strings.outputs.name }}-${{ steps.current_datetime.outputs.time }}.${{ steps.strings.outputsive }}"
retention-days: 1

collect:
Expand All @@ -175,14 +166,20 @@ jobs:
delete_release: true
repo: glKarin/com.n0n3m4.diii4a
github_token: ${{ secrets.TOKEN }}

- name: Get current date time
id: release_datetime
uses: Kaven-Universe/github-action-current-date-time@v1
with:
format: "YYYY-MM-DD_HH-mm-ss"

- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.TOKEN }}"
automatic_release_tag: "win_linux_testing"
prerelease: true
title: "Windows/Linux testing (Non-release. Automatic CI builds)"
title: "[${{steps.release_datetime.outputs.time}}] Windows/Linux testing (Non-release. Automatic CI builds)"
files: |
idTech4A++-testing_win_x64-*.zip
idTech4A++-testing_linux_x64-*.tar.gz
idTech4A++-testing_win*.zip
idTech4A++-testing_linux*.tar.gz

0 comments on commit c746afb

Please sign in to comment.