mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
77 lines
2.2 KiB
YAML
Executable File
77 lines
2.2 KiB
YAML
Executable File
name: build-nmage
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
create:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-nmage-windows:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Install golang
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ">=1.23"
|
|
|
|
- name: Install assimp-go dll
|
|
run: |
|
|
Invoke-WebRequest -Uri "https://github.com/bloeys/assimp-go/releases/download/v0.4.2/libassimp-5.dll" -OutFile "C:\Windows\System32\libassimp-5.dll"
|
|
|
|
- name: Download and setup SDL2
|
|
run: |
|
|
Invoke-WebRequest -Uri "https://github.com/libsdl-org/SDL/releases/download/release-2.30.7/SDL2-devel-2.30.7-mingw.zip" -OutFile "SDL2.zip"
|
|
Expand-Archive -Path "SDL2.zip" -DestinationPath "SDL2"
|
|
dir "C:\msys64\mingw64"
|
|
Copy-Item -Path "SDL2\SDL2-2.30.7\x86_64-w64-mingw32" -Destination "C:\msys64\mingw64" -Recurse -Force
|
|
dir "C:\msys64\mingw64"
|
|
dir "C:\msys64\mingw64\x86_64-w64-mingw32""
|
|
|
|
- name: Clone nmage
|
|
run: git clone https://github.com/bloeys/nmage
|
|
|
|
- name: Build nmage
|
|
working-directory: nmage
|
|
run: go build .
|
|
|
|
build-nmage-macos:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
# Based on: https://github.com/actions/runner-images?tab=readme-ov-file#available-images
|
|
os:
|
|
- macos-13 # x86
|
|
- macos-14 # Arm
|
|
|
|
steps:
|
|
- name: Install golang
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ">=1.23"
|
|
|
|
- name: Determine architecture
|
|
id: arch
|
|
run: |
|
|
if [ "$(uname -m)" = "arm64" ]; then
|
|
echo "arch=arm64" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "arch=amd64" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Install assimp-go dylib
|
|
run: sudo mkdir -p /usr/local/lib && sudo wget https://github.com/bloeys/assimp-go/releases/download/v0.4.2/libassimp_darwin_${{ steps.arch.outputs.arch }}.dylib -O /usr/local/lib/libassimp.5.dylib
|
|
|
|
- name: Install SDL2
|
|
run: brew install sdl2{,_image,_ttf,_gfx} pkg-config
|
|
|
|
- name: Clone nmage
|
|
run: git clone https://github.com/bloeys/nmage
|
|
|
|
- name: build nmage
|
|
working-directory: nmage
|
|
run: go build .
|