no more trolling 🤫 #103
This file contains hidden or 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 & Push Selaura Client | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| env: | |
| CDN_REPO: https://x-access-token:${{ secrets.CDN_TOKEN }}@github.com/selauraclient/cdn.git | |
| COMMIT_EMAIL: "github-actions@users.noreply.github.com" | |
| COMMIT_NAME: "GitHub Actions" | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Configure CMake (Windows) | |
| run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
| - name: Build (Windows) | |
| run: cmake --build build --config Release | |
| - name: Upload Windows Release Binaries | |
| shell: cmd | |
| run: | | |
| git config --global user.email "%COMMIT_EMAIL%" | |
| git config --global user.name "%COMMIT_NAME%" | |
| git clone %CDN_REPO% cdn | |
| :: Ensure clean overwrite | |
| del /f /q cdn\windows\selaura_client.dll >nul 2>&1 | |
| mkdir cdn\windows 2>nul | |
| :: Copy the new DLL in place | |
| copy /Y build\src\client\Release\selaura_client.dll cdn\windows\ | |
| cd cdn | |
| :: Remove the old version from Git index in case it's unchanged | |
| git rm --cached windows\selaura_client.dll >nul 2>&1 | |
| git add windows\selaura_client.dll | |
| :: Always commit so SHA gets new record even if unchanged | |
| git commit --allow-empty -m "Upload Windows release binaries from ${{ github.sha }}" | |
| git push | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Clang and CMake | |
| run: sudo apt-get update && sudo apt-get install -y clang cmake | |
| - name: Configure CMake (Linux with Clang) | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
| - name: Build (Linux) | |
| run: cmake --build build --config Release | |
| - name: Upload Linux Release Binaries | |
| run: | | |
| git config --global user.email "$COMMIT_EMAIL" | |
| git config --global user.name "$COMMIT_NAME" | |
| git clone $CDN_REPO cdn | |
| mkdir -p cdn/linux | |
| find build -type f -name "libSelaura.so" -exec cp {} cdn/linux/ \; | |
| cd cdn | |
| git add . | |
| git commit -m "Upload Linux release binaries from ${{ github.sha }}" || echo "No changes to commit" | |
| git push | |
| build-android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Download and set up Android NDK | |
| uses: nttld/setup-ndk@v1 | |
| with: | |
| ndk-version: r25c | |
| add-to-path: true | |
| - name: Configure CMake (Android) | |
| run: | | |
| cmake -S . -B build-android \ | |
| -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ | |
| -DANDROID_ABI=arm64-v8a \ | |
| -DANDROID_PLATFORM=android-21 \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| - name: Build (Android) | |
| run: cmake --build build-android --config Release | |
| - name: Upload Android Release Binaries | |
| run: | | |
| git config --global user.email "$COMMIT_EMAIL" | |
| git config --global user.name "$COMMIT_NAME" | |
| git clone $CDN_REPO cdn | |
| mkdir -p cdn/android | |
| find build-android -type f -name "libSelaura.so" -exec cp {} cdn/android/ \; | |
| cd cdn | |
| git add . | |
| git commit -m "Upload Android release binaries from ${{ github.sha }}" || echo "No changes to commit" | |
| git push |