Skip to content

SpritesABC update (#122) #65

SpritesABC update (#122)

SpritesABC update (#122) #65

Workflow file for this run

name: Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
release:
name: Identify GitHub Release
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
if: github.event_name != 'push'
- name: Set tag name
id: tag
run: |
tag=$(basename "${{ github.ref }}")
echo "tag=$tag" >> $GITHUB_OUTPUT
release_web:
name: Release (Web)
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y libpulse-dev libgl1-mesa-dev
- name: Cache LLVM host
id: cache-llvm-host
uses: actions/cache@v4
with:
path: ${{github.workspace}}/build_llvm
key: web-cache-llvm-host
- name: Build LLVM host
if: steps.cache-llvm-host.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-project-16.0.0.src.tar.xz
tar -xf llvm-project-16.0.0.src.tar.xz
cmake -B ${{github.workspace}}/build_llvm -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_TARGETS_TO_BUILD=WebAssembly -DLLVM_ENABLE_PROJECTS="clang" -S llvm-project-16.0.0.src/llvm
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- llvm-tblgen
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- clang-tblgen
- name: Set up emsdk
run: |
git clone https://github.com/emscripten-core/emsdk.git ${{github.workspace}}/emsdk
${{github.workspace}}/emsdk/emsdk install 3.1.64
${{github.workspace}}/emsdk/emsdk activate 3.1.64
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v4
with:
path: ${{github.workspace}}/build/_deps
key: web-cache-fetchcontent
- name: Configure (JS)
run: |
source ${{github.workspace}}/emsdk/emsdk_env.sh
emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_TABLEGEN=${{github.workspace}}/build_llvm/bin/llvm-tblgen -DCLANG_TABLEGEN=${{github.workspace}}/build_llvm/bin/clang-tblgen -DARDENS_WEB_JS=1
- name: Build (JS)
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensFlashcart
mkdir ${{github.workspace}}/Ardens_web_js
- name: Create zip file (JS)
run: |
cp ${{github.workspace}}/build/Ardens.js ${{github.workspace}}/Ardens_web_js
cp ${{github.workspace}}/build/ArdensPlayer.js ${{github.workspace}}/Ardens_web_js
cp ${{github.workspace}}/src/Ardens.html ${{github.workspace}}/Ardens_web_js/index.html
cp ${{github.workspace}}/src/ArdensPlayer.html ${{github.workspace}}/Ardens_web_js/player.html
cd ${{github.workspace}}/Ardens_web_js
zip -r ${{github.workspace}}/Ardens_web_js.zip *
- name: Release (JS)
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "${{github.workspace}}/Ardens_web_js.zip"
- name: Configure (WASM)
run: |
source ${{github.workspace}}/emsdk/emsdk_env.sh
emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_TABLEGEN=${{github.workspace}}/build_llvm/bin/llvm-tblgen -DCLANG_TABLEGEN=${{github.workspace}}/build_llvm/bin/clang-tblgen -DARDENS_WEB_JS=0
- name: Build (WASM)
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensFlashcart
mkdir ${{github.workspace}}/Ardens_web_wasm
- name: Create zip file (WASM)
run: |
cp ${{github.workspace}}/build/Ardens.js ${{github.workspace}}/Ardens_web_wasm
cp ${{github.workspace}}/build/Ardens.wasm ${{github.workspace}}/Ardens_web_wasm
cp ${{github.workspace}}/build/ArdensPlayer.js ${{github.workspace}}/Ardens_web_wasm
cp ${{github.workspace}}/build/ArdensPlayer.wasm ${{github.workspace}}/Ardens_web_wasm
cp ${{github.workspace}}/src/Ardens.html ${{github.workspace}}/Ardens_web_wasm/index.html
cp ${{github.workspace}}/src/ArdensPlayer.html ${{github.workspace}}/Ardens_web_wasm/player.html
cd ${{github.workspace}}/Ardens_web_wasm
zip -r ${{github.workspace}}/Ardens_web_wasm.zip *
- name: Pre-Deploy
run: |
cp ${{github.workspace}}/src/live_Ardens.html ${{github.workspace}}/Ardens_web_wasm/index.html
cp ${{github.workspace}}/src/live_ArdensPlayer.html ${{github.workspace}}/Ardens_web_wasm/player.html
cp ${{github.workspace}}/src/live_ArdensFlashcart.html ${{github.workspace}}/Ardens_web_wasm/flashcart.html
cp ${{github.workspace}}/build/ArdensFlashcart.js ${{github.workspace}}/Ardens_web_wasm
cp ${{github.workspace}}/build/ArdensFlashcart.wasm ${{github.workspace}}/Ardens_web_wasm
cp ${{github.workspace}}/src/boot/flashcart.zip ${{github.workspace}}/Ardens_web_wasm
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
token: ${{ secrets.GITHUB_TOKEN }}
folder: ${{github.workspace}}/Ardens_web_wasm
- name: Deploy to GitHub Pages (version)
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
token: ${{ secrets.GITHUB_TOKEN }}
folder: ${{github.workspace}}/Ardens_web_wasm
target-folder: ${{ needs.release.outputs.tag }}
- name: Release (WASM)
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "${{github.workspace}}/Ardens_web_wasm.zip"
release_linux:
name: Release (Linux)
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y libfuse2
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v4
with:
path: _deps
key: windows_x86-cache-fetchcontent
- name: HBB Build
run: bash cmake/build_hbb.sh
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "build/Ardens_linux_x64.zip"
release_windows_x86:
name: Release (Windows x86)
needs: [release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure
run: cmake -D CMAKE_SYSTEM_VERSION=10.0.26100.0 -B ${{github.workspace}}/build -A Win32 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v4
with:
path: ${{github.workspace}}/build/_deps
key: windows_x86-cache-fetchcontent
- name: Build
run: |
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -A Win32 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/Ardens.exe" "Ardens.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ArdensPlayer.exe" "ArdensPlayer.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ardens_libretro.dll" "ardens_libretro.dll"
cmake -E tar "cfv" "Ardens_windows_x86.zip" --format=zip "Ardens.exe" "ArdensPlayer.exe" "ardens_libretro.dll"
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_windows_x86.zip"
release_windows_x64:
name: Release (Windows x64)
needs: [release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure
run: cmake -D CMAKE_SYSTEM_VERSION=10.0.26100.0 -B ${{github.workspace}}/build -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v4
with:
path: ${{github.workspace}}/build/_deps
key: windows_x64-cache-fetchcontent
- name: Build
run: |
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/Ardens.exe" "Ardens.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ArdensPlayer.exe" "ArdensPlayer.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ardens_libretro.dll" "ardens_libretro.dll"
cmake -E tar "cfv" "Ardens_windows_x64.zip" --format=zip "Ardens.exe" "ArdensPlayer.exe" "ardens_libretro.dll"
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_windows_x64.zip"
release_macos_x64:
name: Release (MacOS x64)
needs: [release]
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
mkdir Ardens_macos
cmake -E copy_directory "${{github.workspace}}/build/Ardens.app" "Ardens_macos/Ardens.app"
cmake -E copy_directory "${{github.workspace}}/build/ArdensPlayer.app" "Ardens_macos/ArdensPlayer.app"
cmake -E copy "${{github.workspace}}/build/ardens_libretro.dylib" "Ardens_macos/ardens_libretro.dylib"
hdiutil create -fs JHFS+ -format UDZO "Ardens_macos_x64.dmg" -srcfolder Ardens_macos
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_macos_x64.dmg"
release_macos_arm64:
name: Release (MacOS arm64)
needs: [release]
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Cache LLVM host
id: cache-llvm-host
uses: actions/cache@v4
with:
path: ${{github.workspace}}/build_llvm
key: macos-arm64-cache-llvm-host
- name: Build LLVM host
if: steps.cache-llvm-host.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-project-16.0.0.src.tar.xz
tar -xf llvm-project-16.0.0.src.tar.xz
cmake -B ${{github.workspace}}/build_llvm -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_ENABLE_PROJECTS="clang" -S llvm-project-16.0.0.src/llvm
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- llvm-tblgen
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- clang-tblgen
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_TABLEGEN=${{github.workspace}}/build_llvm/bin/llvm-tblgen -DCLANG_TABLEGEN=${{github.workspace}}/build_llvm/bin/clang-tblgen
- name: Build
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
mkdir Ardens_macos
cmake -E copy_directory "${{github.workspace}}/build/Ardens.app" "Ardens_macos/Ardens.app"
cmake -E copy_directory "${{github.workspace}}/build/ArdensPlayer.app" "Ardens_macos/ArdensPlayer.app"
cmake -E copy "${{github.workspace}}/build/ardens_libretro.dylib" "Ardens_macos/ardens_libretro.dylib"
hdiutil create -fs JHFS+ -format UDZO "Ardens_macos_arm64.dmg" -srcfolder Ardens_macos
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_macos_arm64.dmg"