Skip to content

backbone for stable and nightly builds. #21

backbone for stable and nightly builds.

backbone for stable and nightly builds. #21

Workflow file for this run

name: Build and Release TLEscope
on:
push:
branches: [ "main", "master" ]
tags:
- 'v*' # Triggers stable release on version tags
pull_request:
branches: [ "main", "master" ]
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Linux Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc make libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev libcurl4-openssl-dev
- name: Build and Install Raylib from Source
run: |
git clone --depth 1 https://github.com/raysan5/raylib.git
cd raylib/src
make PLATFORM=PLATFORM_DESKTOP
sudo make install
- name: Compile Linux Binaries
run: make linux
- name: Bundle Linux Release
run: |
mkdir -p TLEscope-Linux
cp bin/TLEscope TLEscope-Linux/
cp bin/fetch_tle TLEscope-Linux/
cp -r resources/ TLEscope-Linux/
cp settings.json TLEscope-Linux/
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Linux
path: TLEscope-Linux/
retention-days: 14
build-windows:
name: Build Windows
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install MinGW (Windows Cross-Compiler)
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64 unzip
- name: Install Windows libcurl
run: |
wget -qO curl.zip "https://curl.se/windows/latest.cgi?p=win64-mingw.zip"
unzip -q curl.zip
# Move headers and libs into the cross-compiler's default search paths
sudo cp -r curl-*-win64-mingw/include/curl /usr/x86_64-w64-mingw32/include/
sudo cp -r curl-*-win64-mingw/lib/* /usr/x86_64-w64-mingw32/lib/
# Stage the required DLL so it gets bundled with the release
mkdir -p bin
cp curl-*-win64-mingw/bin/*.dll bin/
- name: Compile Windows Binaries
run: make windows
- name: Bundle Windows Release
run: |
mkdir -p TLEscope-Windows
cp bin/TLEscope.exe TLEscope-Windows/
# cp bin/fetch_tle.exe TLEscope-Windows/
cp bin/*.dll TLEscope-Windows/
cp -r resources/ TLEscope-Windows/
cp settings.json TLEscope-Windows/
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: TLEscope-Windows
path: TLEscope-Windows/
retention-days: 14
release:
name: Publish Release
needs: [build-linux, build-windows]
# Only run on pushes to main/master or tag pushes (ignore pull requests)
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Zip Artifacts for Release
run: |
cd artifacts
zip -r ../TLEscope-Linux.zip TLEscope-Linux/
zip -r ../TLEscope-Windows.zip TLEscope-Windows/
cd ..
- name: Update Nightly Release
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
uses: softprops/action-gh-release@v2
with:
tag_name: nightly
name: "Nightly Build"
body: "Automated nightly build reflecting the latest commit."
prerelease: true
files: |
TLEscope-Linux.zip
TLEscope-Windows.zip
- name: Publish Stable Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
TLEscope-Linux.zip
TLEscope-Windows.zip