macos build
Some checks failed
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
Build and Deploy / build-macos (push) Failing after 1m46s
Build and Deploy / package-dist (push) Has been skipped
Build and Deploy / deploy-itch (push) Has been skipped
Build and Deploy / deploy-gitea (push) Has been skipped
Some checks failed
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
Build and Deploy / build-macos (push) Failing after 1m46s
Build and Deploy / package-dist (push) Has been skipped
Build and Deploy / deploy-itch (push) Has been skipped
Build and Deploy / deploy-gitea (push) Has been skipped
This commit is contained in:
166
.github/workflows/build.yml
vendored
166
.github/workflows/build.yml
vendored
@@ -3,10 +3,13 @@ name: Build and Deploy
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "*" ]
|
branches: [ "*" ]
|
||||||
tags: [ "v*" ]
|
tags: [ "v*" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
# LINUX BUILD
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
@@ -15,8 +18,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with: { fetch-depth: 0 }
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Build Prosperon (Linux)
|
- name: Build Prosperon (Linux)
|
||||||
run: |
|
run: |
|
||||||
@@ -24,8 +26,7 @@ jobs:
|
|||||||
meson compile -C build
|
meson compile -C build
|
||||||
|
|
||||||
- name: Test Prosperon (Linux)
|
- name: Test Prosperon (Linux)
|
||||||
env:
|
env: { TRACY_NO_INVARIANT_CHECK: 1 }
|
||||||
TRACY_NO_INVARIANT_CHECK: 1
|
|
||||||
run: |
|
run: |
|
||||||
meson test --print-errorlogs -C build
|
meson test --print-errorlogs -C build
|
||||||
strip build/prosperon
|
strip build/prosperon
|
||||||
@@ -44,11 +45,13 @@ jobs:
|
|||||||
name: prosperon-artifacts-linux
|
name: prosperon-artifacts-linux
|
||||||
path: build/prosperon
|
path: build/prosperon
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
# WINDOWS BUILD (MSYS2 / CLANG64)
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: win-native
|
runs-on: win-native
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix: { msystem: [ CLANG64 ] }
|
||||||
msystem: [CLANG64]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
@@ -61,31 +64,26 @@ jobs:
|
|||||||
update: true
|
update: true
|
||||||
cache: true
|
cache: true
|
||||||
install: |
|
install: |
|
||||||
git
|
git zip gzip tar base-devel
|
||||||
zip
|
|
||||||
gzip
|
|
||||||
tar
|
|
||||||
base-devel
|
|
||||||
pacboy: |
|
pacboy: |
|
||||||
meson
|
meson
|
||||||
cmake
|
cmake
|
||||||
toolchain
|
toolchain
|
||||||
|
|
||||||
- name: Build Prosperon
|
- name: Build Prosperon (Windows)
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
run: |
|
run: |
|
||||||
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true -Dtracy:only_localhost=true -Dtracy:no_broadcast=true
|
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true -Dtracy:only_localhost=true -Dtracy:no_broadcast=true
|
||||||
meson compile -C build
|
meson compile -C build
|
||||||
|
|
||||||
- name: Test Prosperon
|
- name: Test Prosperon (Windows)
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
env:
|
env: { TRACY_NO_INVARIANT_CHECK: 1 }
|
||||||
TRACY_NO_INVARIANT_CHECK: 1
|
|
||||||
run: |
|
run: |
|
||||||
meson test --print-errorlogs -C build
|
meson test --print-errorlogs -C build
|
||||||
strip build/prosperon.exe
|
strip build/prosperon.exe
|
||||||
|
|
||||||
- name: Upload Test Log
|
- name: Upload Test Log (Windows)
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -99,15 +97,59 @@ jobs:
|
|||||||
name: prosperon-artifacts-windows
|
name: prosperon-artifacts-windows
|
||||||
path: build/prosperon.exe
|
path: build/prosperon.exe
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
# MACOS BUILD
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
build-macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check Out Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with: { fetch-depth: 0 }
|
||||||
|
|
||||||
|
- name: Build Prosperon (macOS)
|
||||||
|
run: |
|
||||||
|
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true
|
||||||
|
meson compile -C build
|
||||||
|
|
||||||
|
- name: Test Prosperon (macOS)
|
||||||
|
run: |
|
||||||
|
meson test --pring-errorlogs -C build
|
||||||
|
strip build/prosperon
|
||||||
|
|
||||||
|
- name: Upload Test Log (macOS)
|
||||||
|
if: ${{ always() }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: testlog-macos
|
||||||
|
path: build/meson-logs/testlog.txt
|
||||||
|
|
||||||
|
- name: Create artifact folder (macOS)
|
||||||
|
run: |
|
||||||
|
mkdir _pack
|
||||||
|
cp build_macos/prosperon _pack/
|
||||||
|
cp sdl3-macos/libSDL3*.dylib _pack/ || true
|
||||||
|
|
||||||
|
- name: Upload Artifact (macOS)
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: prosperon-artifacts-macos
|
||||||
|
path: prosperon
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
# PACKAGE CROSS-PLATFORM DIST
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
package-dist:
|
package-dist:
|
||||||
needs: [build-linux, build-windows]
|
needs: [ build-linux, build-windows, build-macos ]
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with: { fetch-depth: 0 }
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Get Latest Tag
|
- name: Get Latest Tag
|
||||||
id: get_tag
|
id: get_tag
|
||||||
@@ -127,16 +169,21 @@ jobs:
|
|||||||
name: prosperon-artifacts-windows
|
name: prosperon-artifacts-windows
|
||||||
path: windows_artifacts
|
path: windows_artifacts
|
||||||
|
|
||||||
- name: Create the Dist Folder
|
- name: Download macOS Artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: prosperon-artifacts-macos
|
||||||
|
path: mac_artifacts
|
||||||
|
|
||||||
|
- name: Create Dist Folder
|
||||||
run: |
|
run: |
|
||||||
mkdir dist
|
mkdir -p dist/linux dist/win dist/mac
|
||||||
cp README.md dist/
|
cp README.md dist/
|
||||||
cp license.txt dist/
|
cp license.txt dist/
|
||||||
cp -r examples dist/
|
cp -r examples dist/
|
||||||
mkdir dist/linux
|
cp linux_artifacts/* dist/linux/
|
||||||
mkdir dist/win
|
|
||||||
cp linux_artifacts/* dist/linux/
|
|
||||||
cp windows_artifacts/* dist/win/
|
cp windows_artifacts/* dist/win/
|
||||||
|
cp mac_artifacts/* dist/mac/
|
||||||
|
|
||||||
- name: Package Final Dist
|
- name: Package Final Dist
|
||||||
run: |
|
run: |
|
||||||
@@ -150,14 +197,17 @@ jobs:
|
|||||||
name: "prosperon-${{ steps.get_tag.outputs.tag }}"
|
name: "prosperon-${{ steps.get_tag.outputs.tag }}"
|
||||||
path: "prosperon-${{ steps.get_tag.outputs.tag }}.zip"
|
path: "prosperon-${{ steps.get_tag.outputs.tag }}.zip"
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
# DEPLOY TO ITCH.IO (single ZIP containing all OSes)
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
deploy-itch:
|
deploy-itch:
|
||||||
needs: [package-dist]
|
needs: [ package-dist ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with: { fetch-depth: 0 }
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Get Latest Tag
|
- name: Get Latest Tag
|
||||||
id: get_tag
|
id: get_tag
|
||||||
@@ -176,25 +226,30 @@ jobs:
|
|||||||
|
|
||||||
- name: Push to itch.io
|
- name: Push to itch.io
|
||||||
run: |
|
run: |
|
||||||
butler push "dist/prosperon-${{ steps.get_tag.outputs.tag }}.zip" ${{ secrets.ITCHIO_USERNAME }}/prosperon:win-linux --userversion ${{ steps.get_tag.outputs.tag }}
|
butler push "dist/prosperon-${{ steps.get_tag.outputs.tag }}.zip" \
|
||||||
|
${{ secrets.ITCHIO_USERNAME }}/prosperon:universal \
|
||||||
|
--userversion ${{ steps.get_tag.outputs.tag }}
|
||||||
env:
|
env:
|
||||||
BUTLER_API_KEY: ${{ secrets.ITCHIO_API_KEY }}
|
BUTLER_API_KEY: ${{ secrets.ITCHIO_API_KEY }}
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
# DEPLOY TO SELF-HOSTED GITEA
|
||||||
|
# ──────────────────────────────────────────────────────────────
|
||||||
deploy-gitea:
|
deploy-gitea:
|
||||||
needs: [package-dist]
|
needs: [ package-dist ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with: { fetch-depth: 0 }
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Get Latest Tag and Commit Message
|
- name: Get Latest Tag & Commit Message
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: |
|
run: |
|
||||||
TAG=$(git describe --tags --abbrev=0)
|
TAG=$(git describe --tags --abbrev=0)
|
||||||
COMMIT_MSG=$(git log -1 --pretty=%B "${TAG}")
|
COMMIT_MSG=$(git log -1 --pretty=%B "$TAG")
|
||||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
echo "commit_msg=$COMMIT_MSG" >> $GITHUB_OUTPUT
|
echo "commit_msg=$COMMIT_MSG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Download Final Distribution
|
- name: Download Final Distribution
|
||||||
@@ -203,39 +258,26 @@ jobs:
|
|||||||
name: "prosperon-${{ steps.get_tag.outputs.tag }}"
|
name: "prosperon-${{ steps.get_tag.outputs.tag }}"
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- name: Create or Update Gitea Release
|
- name: Create / Update Gitea Release
|
||||||
run: |
|
run: |
|
||||||
TAG=${{ steps.get_tag.outputs.tag }}
|
TAG=${{ steps.get_tag.outputs.tag }}
|
||||||
ZIP_FILE="dist/prosperon-${TAG}.zip"
|
ZIP=dist/prosperon-${TAG}.zip
|
||||||
COMMIT_MSG=$(echo "${{ steps.get_tag.outputs.commit_msg }}" | jq -R -s '.')
|
BODY=$(echo "${{ steps.get_tag.outputs.commit_msg }}" | jq -R -s '.')
|
||||||
|
RELEASE=$(curl -s -H "Authorization: token ${{ secrets.TOKEN_GITEA }}" \
|
||||||
|
"https://gitea.pockle.world/api/v1/repos/john/prosperon/releases/tags/$TAG" | jq -r '.id')
|
||||||
|
|
||||||
# Check if release exists
|
if [ "$RELEASE" = "null" ] || [ -z "$RELEASE" ]; then
|
||||||
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.TOKEN_GITEA }}" \
|
RELEASE=$(curl -X POST \
|
||||||
"https://gitea.pockle.world/api/v1/repos/john/prosperon/releases/tags/${TAG}" | jq -r '.id')
|
|
||||||
|
|
||||||
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" == "null" ]; then
|
|
||||||
# Create a new release if it doesn't exist
|
|
||||||
echo "Creating new release for tag ${TAG}"
|
|
||||||
RELEASE_ID=$(curl -X POST \
|
|
||||||
-H "Authorization: token ${{ secrets.TOKEN_GITEA }}" \
|
-H "Authorization: token ${{ secrets.TOKEN_GITEA }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\":\"${TAG}\",\"target_commitish\":\"${{ github.sha }}\",\"name\":\"${TAG}\",\"body\":${COMMIT_MSG},\"draft\":false,\"prerelease\":false}" \
|
-d "{\"tag_name\":\"$TAG\",\"target_commitish\":\"${{ github.sha }}\",\"name\":\"$TAG\",\"body\":$BODY,\"draft\":false,\"prerelease\":false}" \
|
||||||
"https://gitea.pockle.world/api/v1/repos/john/prosperon/releases" | jq -r '.id')
|
"https://gitea.pockle.world/api/v1/repos/john/prosperon/releases" | jq -r '.id')
|
||||||
|
|
||||||
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" == "null" ]; then
|
|
||||||
echo "Failed to create release for tag ${TAG}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Created release with ID: ${RELEASE_ID}"
|
|
||||||
else
|
|
||||||
echo "Release already exists with ID: ${RELEASE_ID}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Upload the zip file as an asset
|
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Authorization: token ${{ secrets.TOKEN_GITEA }}" \
|
-H "Authorization: token ${{ secrets.TOKEN_GITEA }}" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
--data-binary @"${ZIP_FILE}" \
|
--data-binary @"$ZIP" \
|
||||||
"https://gitea.pockle.world/api/v1/repos/john/prosperon/releases/${RELEASE_ID}/assets?name=prosperon-${TAG}.zip"
|
"https://gitea.pockle.world/api/v1/repos/john/prosperon/releases/$RELEASE/assets?name=prosperon-${TAG}.zip"
|
||||||
env:
|
env:
|
||||||
TOKEN_GITEA: ${{ secrets.TOKEN_GITEA }}
|
TOKEN_GITEA: ${{ secrets.TOKEN_GITEA }}
|
||||||
|
|||||||
64
.github/workflows/macbuild.yml
vendored
64
.github/workflows/macbuild.yml
vendored
@@ -1,64 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# ===============================================================
|
|
||||||
# MACOS BUILD (Using Homebrew SDL3)
|
|
||||||
# ===============================================================
|
|
||||||
build-macos:
|
|
||||||
runs-on: macos-latest
|
|
||||||
continue-on-error: true
|
|
||||||
steps:
|
|
||||||
# 1) Check out code
|
|
||||||
- name: Check Out Code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# 2) Install dependencies (SDL3 via Homebrew) + ccache
|
|
||||||
- name: Install Dependencies (macOS)
|
|
||||||
run: |
|
|
||||||
brew update
|
|
||||||
brew install sdl3 meson ninja cmake ccache
|
|
||||||
|
|
||||||
# 3) Configure ccache
|
|
||||||
- name: Configure ccache
|
|
||||||
run: |
|
|
||||||
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
||||||
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# 4) Cache ccache
|
|
||||||
- name: Cache ccache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/Library/Caches/ccache
|
|
||||||
key: ccache-macos-${{ hashFiles('**/*.c', '**/*.cpp', '**/*.h', '**/CMakeLists.txt', '**/meson.build') }}
|
|
||||||
restore-keys: |
|
|
||||||
ccache-macos-
|
|
||||||
|
|
||||||
# 5) Build Prosperon (macOS) linking against Homebrew's SDL3
|
|
||||||
- name: Build Prosperon (macOS)
|
|
||||||
run: |
|
|
||||||
# Ensure pkg-config can find Homebrew's SDL3 .pc files
|
|
||||||
export PKG_CONFIG_PATH="$(brew --prefix sdl3)/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
||||||
meson setup build_macos -Dbuildtype=release -Db_lto=true -Db_ndebug=true
|
|
||||||
meson compile -C build_macos
|
|
||||||
|
|
||||||
# 6) Copy SDL3 .dylib from Homebrew for packaging
|
|
||||||
- name: Copy SDL3 library for packaging
|
|
||||||
run: |
|
|
||||||
SDL3_PREFIX=$(brew --prefix sdl3)
|
|
||||||
mkdir -p sdl3-macos
|
|
||||||
# Copy all versions of the SDL3 dynamic library
|
|
||||||
cp -a "${SDL3_PREFIX}/lib/libSDL3*.dylib" sdl3-macos/ || echo "No .dylib found, ignoring"
|
|
||||||
|
|
||||||
# 7) Create minimal artifact folder (macOS)
|
|
||||||
- name: Create artifact folder (macOS)
|
|
||||||
run: |
|
|
||||||
mkdir _pack
|
|
||||||
cp build_macos/prosperon _pack/
|
|
||||||
cp sdl3-macos/libSDL3*.dylib _pack/ || echo "No .dylib found, ignoring"
|
|
||||||
|
|
||||||
# 8) Upload artifact (macOS)
|
|
||||||
- name: Upload Artifact (macOS)
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: prosperon-artifacts-macos
|
|
||||||
path: _pack
|
|
||||||
Reference in New Issue
Block a user