Format #56
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: Release | |
on: | |
push: | |
branches: [main, dev] | |
env: | |
BRANCH: "main" | |
DATE_TAG: "v3.0.1" | |
RAYLIB_TAG: "5.0" | |
RAYLIB_CPP_TAG: "v5.0.2" | |
ENET_TAG: "v2.3.10" | |
ZSTD_TAG: "v1.5.5" | |
HTTPLIB_TAG: "v0.18.1" | |
jobs: | |
release-create: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
outputs: | |
release: ${{ steps.release.outputs.release_tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: release | |
name: Create Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then | |
export GITHUB_OUTPUT=$GITHUB_OUTPUT | |
bash ./.github/workflows/release.sh "${{ env.BRANCH }}" | |
else | |
echo "release_tag=0.0.0" >> $GITHUB_OUTPUT | |
fi | |
# ---------------------------------------------------------------------------- | |
# -------------------------- TO TAR | |
# ---------------------------------------------------------------------------- | |
zstd-to-tar: | |
runs-on: ubuntu-latest | |
needs: release-create | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: sudo apt-get update && sudo apt-get install -y tar git | |
- name: Get Zstd | |
run: | | |
git clone https://github.com/facebook/zstd.git zstd-repo | |
cd zstd-repo || exit 14 | |
git checkout ${{ env.ZSTD_TAG }} | |
rm -rf .git | |
cd .. | |
- name: To Tar | |
run: | | |
tar -cvf zstd.tar zstd-repo | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./zstd.tar | |
# - name: Upload To Artifact | |
# if: github.ref != 'refs/heads/main' | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: zstd.tar | |
# path: ./zstd.tar | |
date-to-tar: | |
runs-on: ubuntu-latest | |
needs: release-create | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: sudo apt-get update && sudo apt-get install -y tar git | |
- name: Get Date | |
run: | | |
git clone https://github.com/HowardHinnant/date.git date-repo | |
cd date-repo || exit 14 | |
git checkout ${{ env.DATE_TAG }} | |
rm -rf .git | |
cd .. | |
- name: To Tar | |
run: | | |
tar -cvf date.tar date-repo | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./date.tar | |
# - name: Upload To Artifact | |
# if: github.ref != 'refs/heads/main' | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: date.tar | |
# path: ./date.tar | |
httplib-to-tar: | |
runs-on: ubuntu-latest | |
needs: release-create | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: sudo apt-get update && sudo apt-get install -y tar git | |
- name: Get Httplib | |
run: | | |
git clone https://github.com/yhirose/cpp-httplib.git httplib-repo | |
cd httplib-repo || exit 14 | |
git checkout ${{ env.HTTPLIB_TAG }} | |
rm -rf .git | |
rm CMakeLists.txt | |
mkdir include | |
mv httplib.h include/httplib.h | |
cd .. | |
- name: To Tar | |
run: | | |
tar -cvf httplib.tar httplib-repo | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./httplib.tar | |
# - name: Upload To Artifact | |
# if: github.ref != 'refs/heads/main' | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: date.tar | |
# path: ./date.tar | |
enet-to-tar: | |
runs-on: ubuntu-latest | |
needs: release-create | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: sudo apt-get update && sudo apt-get install -y tar git curl | |
- name: Get Enet | |
run: | | |
mkdir enet-repo | |
mkdir enet-repo/include | |
curl -Lo enet-repo/include/enet.h "https://github.com/zpl-c/enet/releases/download/${{ env.ENET_TAG }}/enet.h" | |
- name: To Tar | |
run: | | |
tar -cvf enet.tar enet-repo | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./enet.tar | |
# - name: Upload To Artifact | |
# if: github.ref != 'refs/heads/main' | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: enet.tar | |
# path: ./enet.tar | |
raylib-to-tar: | |
runs-on: ubuntu-latest | |
needs: release-create | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: sudo apt-get update && sudo apt-get install -y tar git | |
- name: Get Raylib | |
run: | | |
git clone --recurse-submodules https://github.com/raysan5/raylib.git raylib-repo | |
cd raylib-repo || exit 14 | |
git checkout ${{ env.RAYLIB_TAG }} | |
rm -rf .git/ | |
rm -rf .github/ | |
rm -rf examples/ | |
rm -rf projects/ | |
cd .. | |
- name: To Tar | |
run: | | |
tar -cvf raylib.tar raylib-repo | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./raylib.tar | |
# - name: Upload To Artifact | |
# if: github.ref != 'refs/heads/main' | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: raylib.tar | |
# path: ./raylib.tar | |
raylibcpp-to-tar: | |
runs-on: ubuntu-latest | |
needs: release-create | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install deps | |
run: sudo apt-get update && sudo apt-get install -y tar git | |
- name: Get RaylibCPP | |
run: | | |
git clone https://github.com/RobLoach/raylib-cpp.git raylib-cpp-repo | |
cd raylib-cpp-repo || exit 14 | |
git checkout ${{ env.RAYLIB_CPP_TAG }} | |
rm -rf .git | |
cd .. | |
- name: To Tar | |
run: | | |
tar -cvf raylib-cpp.tar raylib-cpp-repo | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./raylib-cpp.tar | |
# - name: Upload To Artifact | |
# if: github.ref != 'refs/heads/main' | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: raylib-cpp.tar | |
# path: ./raylib-cpp.tar | |
# ---------------------------------------------------------------------------- | |
# -------------------------- BINARY CLIENT | |
# ---------------------------------------------------------------------------- | |
release-client-windows: | |
runs-on: windows-latest | |
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar, zstd-to-tar, httplib-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install winget | |
uses: Cyberboss/install-winget@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: | | |
cd client | |
./scripts/install-deps-windows.ps1 | |
- name: Build | |
run: | | |
cd client | |
./scripts/bundle-windows.ps1 | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb-windows.zip | |
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb-windows.exe | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb-windows.zip | |
path: ./client/Colomb-windows.zip | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb-windows.exe | |
path: ./client/Colomb-windows.exe | |
release-client-linux: | |
runs-on: ubuntu-latest | |
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar, zstd-to-tar, httplib-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
cd client | |
sudo ./scripts/install-deps-linux.sh | |
- name: Build | |
run: | | |
cd client | |
./scripts/bundle-linux.sh | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb-linux.tar.gz | |
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb-linux.sh | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb-linux.tar.gz | |
path: ./client/Colomb-linux.tar.gz | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb-linux.sh | |
path: ./client/Colomb-linux.sh | |
release-client-macos: | |
runs-on: macos-latest | |
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar, zstd-to-tar, httplib-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
cd client | |
./scripts/install-deps-macos.sh | |
- name: Build | |
run: | | |
cd client | |
./scripts/bundle-macos.sh | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb-macos.zip | |
gh release upload ${{ needs.release-create.outputs.release }} ./client/Colomb-macos.dmg | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb-macos.dmg | |
path: ./client/Colomb-macos.dmg | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb-macos.zip | |
path: ./client/Colomb-macos.zip | |
# ---------------------------------------------------------------------------- | |
# -------------------------- BINARY SERVER | |
# ---------------------------------------------------------------------------- | |
release-server-linux: | |
runs-on: ubuntu-latest | |
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar, zstd-to-tar, httplib-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
cd server | |
sudo ./scripts/install-deps-linux.sh | |
- name: Build | |
run: | | |
cd server | |
./scripts/bundle-linux.sh | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./server/Colomb_server-linux.tar.gz | |
gh release upload ${{ needs.release-create.outputs.release }} ./server/Colomb_server-linux.sh | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb_server-linux.tar.gz | |
path: ./server/Colomb_server-linux.tar.gz | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb_server-linux.sh | |
path: ./server/Colomb_server-linux.sh | |
release-server-macos: | |
runs-on: macos-latest | |
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar, zstd-to-tar, httplib-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
cd server | |
./scripts/install-deps-macos.sh | |
- name: Build | |
run: | | |
cd server | |
./scripts/bundle-macos.sh | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./server/Colomb_server-macos.zip | |
gh release upload ${{ needs.release-create.outputs.release }} ./server/Colomb_server-macos.dmg | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb_server-macos.dmg | |
path: ./server/Colomb_server-macos.dmg | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb_server-macos.zip | |
path: ./server/Colomb-macos.zip | |
release-server-windows: | |
runs-on: windows-latest | |
needs: [release-create, date-to-tar, raylib-to-tar, raylibcpp-to-tar, enet-to-tar, zstd-to-tar, httplib-to-tar] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install winget | |
uses: Cyberboss/install-winget@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: | | |
cd server | |
./scripts/install-deps-windows.ps1 | |
- name: Build | |
run: | | |
cd server | |
./scripts/bundle-windows.ps1 | |
- name: Upload To Release | |
if: github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-create.outputs.release }} ./server/Colomb_server-windows.zip | |
gh release upload ${{ needs.release-create.outputs.release }} ./server/Colomb_server-windows.exe | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb_server-windows.zip | |
path: ./server/Colomb_server-windows.zip | |
- name: Upload To Artifact | |
if: github.ref != 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Colomb_server-windows.exe | |
path: ./server/Colomb_server-windows.exe |