Merge pull request #77 from Vladislav4KZ/yapb-extras #44
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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
android: | |
name: Android | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Install YaPB Extras | |
run: mv 3rdparty/yapb/cfg/addons 3rdparty/cs16client-extras | |
- name: Fetch YaPB Graphs from DB | |
run: scripts/yapb_graph_dl.sh | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Build | |
run: ./gradlew assembleDebug | |
- name: Sign APK | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: app/build/outputs/apk/debug | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "34.0.0" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: android | |
path: app/build/outputs/apk/debug/app-debug-signed.apk | |
# psvita: | |
# name: PS Vita | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout sources | |
# uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 0 | |
# submodules: recursive | |
# - name: Setup PS Vita SDK | |
# run: scripts/psvita_sdk.sh | |
windows: | |
name: Windows | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
arch: ['x86', 'amd64'] | |
fail-fast: false | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Setup Visual Studio | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Configure project | |
run: cmake --preset "win32-release-${{ matrix.arch }}" | |
- name: Run appversion.sh | |
run: regamedll/version/appversion.sh "${{ github.workspace }}/3rdparty/ReGameDLL_CS" | |
shell: bash | |
working-directory: 3rdparty/ReGameDLL_CS | |
- name: Build | |
run: cmake --build . | |
working-directory: build | |
- name: Generate extras.pk3 | |
run: Compress-Archive -Path 3rdparty/cs16client-extras/* -Destination build/extras.pk3 -CompressionLevel NoCompression | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: win32-${{ matrix.arch }} | |
path: | | |
build/3rdparty/ReGameDLL_CS/regamedll/mp.dll | |
build/3rdparty/ReGameDLL_CS/regamedll/mp_amd64.dll | |
build/3rdparty/mainui_cpp/menu.dll | |
build/3rdparty/mainui_cpp/menu_amd64.dll | |
build/cl_dll/client.dll | |
build/cl_dll/client_amd64.dll | |
build/extras.pk3 | |
linux: | |
name: Linux | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: ['i386', 'amd64'] | |
fail-fast: false | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install libatomic1:i386 libgcc-s1:i386 \ | |
libstdc++6:i386 gcc-multilib g++-multilib cmake \ | |
ninja-build libfontconfig-dev:i386 libfontconfig-dev | |
- name: Configure project | |
run: | | |
if [[ ${{ matrix.arch }} == i386 ]]; then | |
export CC="gcc -m32" | |
export CXX="g++ -m32" | |
fi | |
cmake --preset "linux-release-${{ matrix.arch }}" | |
- name: Build | |
run: cmake --build . | |
working-directory: build | |
- name: Generate extras.pk3 | |
run: zip -0 -r build/extras.pk3 3rdparty/cs16client-extras | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-${{ matrix.arch }} | |
path: | | |
build/3rdparty/ReGameDLL_CS/regamedll/cs.so | |
build/3rdparty/ReGameDLL_CS/regamedll/cs_amd64.so | |
build/3rdparty/mainui_cpp/menu.so | |
build/3rdparty/mainui_cpp/menu_amd64.so | |
build/cl_dll/client.so | |
build/cl_dll/client_amd64.so | |
build/extras.pk3 | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [android, windows, linux] | |
steps: | |
- name: Fetch artifacts | |
uses: actions/download-artifact@v4 | |
- name: Remove old release | |
uses: ClementTsang/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: continuous | |
delete_release: true | |
repo: ${{ env.GITHUB_REPOSITORY }} | |
- name: Repackage binaries | |
run: | | |
mv android/app-debug-signed.apk cs16-client.apk | |
mkdir -p cstrike/{dlls,cl_dlls} | |
mv win32-x86/3rdparty/ReGameDLL_CS/regamedll/mp.dll cstrike/dlls | |
mv win32-x86/3rdparty/mainui_cpp/menu.dll cstrike/cl_dlls | |
mv win32-x86/cl_dll/client.dll cstrike/cl_dlls | |
mv win32-x86/extras.pk3 cstrike | |
zip -r cs16-client_win32_x86.zip cstrike/ | |
rm -r cstrike | |
mkdir -p cstrike/{dlls,cl_dlls} | |
mv win32-amd64/3rdparty/ReGameDLL_CS/regamedll/mp_amd64.dll cstrike/dlls | |
mv win32-amd64/3rdparty/mainui_cpp/menu_amd64.dll cstrike/cl_dlls | |
mv win32-amd64/cl_dll/client_amd64.dll cstrike/cl_dlls | |
mv win32-amd64/extras.pk3 cstrike | |
zip -r cs16-client_win32_amd64.zip cstrike/ | |
rm -r cstrike | |
mkdir -p cstrike/{dlls,cl_dlls} | |
mv linux-i386/3rdparty/ReGameDLL_CS/regamedll/cs.so cstrike/dlls | |
mv linux-i386/3rdparty/mainui_cpp/menu.so cstrike/cl_dlls | |
mv linux-i386/cl_dll/client.so cstrike/cl_dlls | |
mv linux-i386/extras.pk3 cstrike | |
tar -czvf cs16-client_linux_i386.tar.gz cstrike/ | |
rm -r cstrike | |
mkdir -p cstrike/{dlls,cl_dlls} | |
mv linux-amd64/3rdparty/ReGameDLL_CS/regamedll/cs_amd64.so cstrike/dlls | |
mv linux-amd64/3rdparty/mainui_cpp/menu_amd64.so cstrike/cl_dlls | |
mv linux-amd64/cl_dll/client_amd64.so cstrike/cl_dlls | |
mv linux-amd64/extras.pk3 cstrike | |
tar -czvf cs16-client_linux_amd64.tar.gz cstrike/ | |
sleep 60s | |
- name: Purge artifacts | |
uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: "*" | |
- name: Upload new release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_name: ${{ env.GITHUB_REPOSITORY }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file_glob: true | |
file: cs16-client* | |
tag: continuous | |
overwrite: true | |
prerelease: true | |
release_name: CS16Client development build |