Files
nmage/.github/workflows/build-nmage.yml
bloeys 1bec97b128 test
2024-09-15 18:41:31 +04:00

78 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: |
$env:path
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:\mingw64"
dir "C:\mingw64\bin"
Copy-Item -Path "SDL2\SDL2-2.30.7\x86_64-w64-mingw32" -Destination "C:\mingw64" -Recurse -Force
dir "C:\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 .