Simplify Artifact Handling and Upgrade to actions/*-artifact@v4 #93
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: EX Emulators | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: ["2600.emu", "C64.emu", "GBA.emu", "GBC.emu", "Lynx.emu", "MD.emu", "MSX.emu", "NEO.emu", "NES.emu", "NGP.emu", "PCE.emu", "Snes9x", "Snes9x-1.43-9", "Snes9x-1.43-15", "Swan.emu", "Saturn.emu"] | |
steps: | |
- name: Checkout emu-ex-plus-alpha repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Decode debug keystore | |
env: | |
DEBUG_KEYSTORE: ${{ secrets.DEBUG_KEYSTORE }} | |
run: | | |
if [ -z "$DEBUG_KEYSTORE" ] | |
then | |
echo "No debug keystore value" | |
else | |
echo $DEBUG_KEYSTORE > debug.keystore.base64 | |
base64 --decode debug.keystore.base64 > debug.keystore | |
sudo cp -f debug.keystore /root/.android/. | |
fi | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends autoconf automake autopoint bash binutils-arm-linux-gnueabi clang cmake file gawk gettext git libtool libtool-bin llvm make nasm pkg-config unzip wget | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Set up environment | |
run: | | |
mkdir imagine-sdk | |
mkdir EX-Emulators | |
wget "https://dl.google.com/android/repository/android-ndk-r26b-linux.zip" | |
unzip android-ndk-r26b-linux.zip | |
echo "ANDROID_NDK_PATH=${{ github.workspace }}/android-ndk-r26b" >> $GITHUB_ENV | |
echo "EMUFRAMEWORK_PATH=${{ github.workspace }}/EmuFramework" >> $GITHUB_ENV | |
echo "IMAGINE_PATH=${{ github.workspace }}/imagine" >> $GITHUB_ENV | |
echo "IMAGINE_SDK_PATH=${{ github.workspace }}/imagine-sdk" >> $GITHUB_ENV | |
- name: Run script | |
run: | | |
cd imagine/bundle/all | |
chmod +x ./makeAll-android.sh | |
./makeAll-android.sh install | |
shell: bash | |
- name: Build environment | |
run: | | |
make -f $IMAGINE_PATH/android-release.mk install V=1 -j`nproc` | |
make -f $EMUFRAMEWORK_PATH/android-release.mk config -j`nproc` | |
make -f $EMUFRAMEWORK_PATH/android-release.mk install V=1 -j`nproc` | |
- name: Build 2600.emu | |
if: ${{ matrix.image == '2600.emu' }} | |
run: | | |
cd 2600.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy 2600.emu artifact | |
if: ${{ matrix.image == '2600.emu' }} | |
run: | | |
cp 2600.emu/target/android-release/build/outputs/apk/release/2600Emu-release.apk EX-Emulators/2600Emu.apk | |
- name: Build C64.emu | |
if: ${{ matrix.image == 'C64.emu' }} | |
run: | | |
cd C64.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy C64.emu artifact | |
if: ${{ matrix.image == 'C64.emu' }} | |
run: | | |
cp C64.emu/target/android-release/build/outputs/apk/release/C64Emu-release.apk EX-Emulators/C64Emu.apk | |
- name: Build GBA.emu | |
if: ${{ matrix.image == 'GBA.emu' }} | |
run: | | |
cd GBA.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy GBA.emu artifact | |
if: ${{ matrix.image == 'GBA.emu' }} | |
run: | | |
cp GBA.emu/target/android-release/build/outputs/apk/release/GbaEmu-release.apk EX-Emulators/GbaEmu.apk | |
- name: Build GBC.emu | |
if: ${{ matrix.image == 'GBC.emu' }} | |
run: | | |
cd GBC.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy GBC.emu artifact | |
if: ${{ matrix.image == 'GBC.emu' }} | |
run: | | |
cp GBC.emu/target/android-release/build/outputs/apk/release/GbcEmu-release.apk EX-Emulators/GbcEmu.apk | |
- name: Build Lynx.emu | |
if: ${{ matrix.image == 'Lynx.emu' }} | |
run: | | |
cd Lynx.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy Lynx.emu artifact | |
if: ${{ matrix.image == 'Lynx.emu' }} | |
run: | | |
cp Lynx.emu/target/android-release/build/outputs/apk/release/LynxEmu-release.apk EX-Emulators/LynxEmu.apk | |
- name: Build MD.emu | |
if: ${{ matrix.image == 'MD.emu' }} | |
run: | | |
cd MD.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy MD.emu artifact | |
if: ${{ matrix.image == 'MD.emu' }} | |
run: | | |
cp MD.emu/target/android-release/build/outputs/apk/release/MdEmu-release.apk EX-Emulators/MdEmu.apk | |
- name: Build MSX.emu | |
if: ${{ matrix.image == 'MSX.emu' }} | |
run: | | |
cd MSX.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy MSX.emu artifact | |
if: ${{ matrix.image == 'MSX.emu' }} | |
run: | | |
cp MSX.emu/target/android-release/build/outputs/apk/release/MsxEmu-release.apk EX-Emulators/MsxEmu.apk | |
- name: Build NEO.emu | |
if: ${{ matrix.image == 'NEO.emu' }} | |
run: | | |
cd NEO.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy NEO.emu artifact | |
if: ${{ matrix.image == 'NEO.emu' }} | |
run: | | |
cp NEO.emu/target/android-release/build/outputs/apk/release/NeoEmu-release.apk EX-Emulators/NeoEmu.apk | |
- name: Build NES.emu | |
if: ${{ matrix.image == 'NES.emu' }} | |
run: | | |
cd NES.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy NES.emu artifact | |
if: ${{ matrix.image == 'NES.emu' }} | |
run: | | |
cp NES.emu/target/android-release/build/outputs/apk/release/NesEmu-release.apk EX-Emulators/NesEmu.apk | |
- name: Build NGP.emu | |
if: ${{ matrix.image == 'NGP.emu' }} | |
run: | | |
cd NGP.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy NGP.emu artifact | |
if: ${{ matrix.image == 'NGP.emu' }} | |
run: | | |
cp NGP.emu/target/android-release/build/outputs/apk/release/NgpEmu-release.apk EX-Emulators/NgpEmu.apk | |
- name: Build PCE.emu | |
if: ${{ matrix.image == 'PCE.emu' }} | |
run: | | |
cd PCE.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy PCE.emu artifact | |
if: ${{ matrix.image == 'PCE.emu' }} | |
run: | | |
cp PCE.emu/target/android-release/build/outputs/apk/release/PceEmu-release.apk EX-Emulators/PceEmu.apk | |
- name: Build Snes9x | |
if: ${{ matrix.image == 'Snes9x' }} | |
run: | | |
cd Snes9x | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy Snes9x artifact | |
if: ${{ matrix.image == 'Snes9x' }} | |
run: | | |
cp Snes9x/target/android-release/build/outputs/apk/release/Snes9xEXPlus-release.apk EX-Emulators/Snes9xEXPlus.apk | |
- name: Build Snes9x-1.43-9 | |
if: ${{ matrix.image == 'Snes9x-1.43-9' }} | |
run: | | |
cd Snes9x/1.43 | |
make -f android-release-9.mk android-apk V=1 -j`nproc` | |
- name: Copy Snes9x-1.43-9 artifact | |
if: ${{ matrix.image == 'Snes9x-1.43-9' }} | |
run: | | |
cp Snes9x/1.43/target/android-release-9/build/outputs/apk/release/Snes9xEX-release.apk EX-Emulators/Snes9xEX-9.apk | |
- name: Build Snes9x-1.43-15 | |
if: ${{ matrix.image == 'Snes9x-1.43-15' }} | |
run: | | |
cd Snes9x/1.43 | |
make -f android-release-15.mk android-apk V=1 -j`nproc` | |
- name: Copy Snes9x-1.43-15 artifact | |
if: ${{ matrix.image == 'Snes9x-1.43-15' }} | |
run: | | |
cp Snes9x/1.43/target/android-release-15/build/outputs/apk/release/Snes9xEX-release.apk EX-Emulators/Snes9xEX-15.apk | |
- name: Build Swan.emu | |
if: ${{ matrix.image == 'Swan.emu' }} | |
run: | | |
cd Swan.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy Swan.emu artifact | |
if: ${{ matrix.image == 'Swan.emu' }} | |
run: | | |
cp Swan.emu/target/android-release/build/outputs/apk/release/SwanEmu-release.apk EX-Emulators/SwanEmu.apk | |
- name: Build Saturn.emu | |
if: ${{ matrix.image == 'Saturn.emu' }} | |
run: | | |
cd Saturn.emu | |
make -f android-release.mk android-apk V=1 -j`nproc` | |
- name: Copy Saturn.emu artifact | |
if: ${{ matrix.image == 'Saturn.emu' }} | |
run: | | |
cp Saturn.emu/target/android-release/build/outputs/apk/release/SaturnEmu-release.apk EX-Emulators/SaturnEmu.apk | |
- name: Upload EX-Emulators artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: EX-Emulators-${{ matrix.image }} | |
path: EX-Emulators/ | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout emu-ex-plus-alpha repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: EX-Emulators | |
pattern: EX-Emulators-* | |
merge-multiple: true | |
- name: Re-zip artifacts | |
run: | | |
mkdir dist | |
cd EX-Emulators || exit 1 | |
for artifact in *.apk | |
do | |
emulator_name="${artifact%.apk}" | |
echo "-> Creating ${emulator_name}.zip" | |
zip "../dist/${emulator_name}.zip" "${emulator_name}.apk" | |
done | |
zip -r ../dist/EX-Emulators.zip *.apk | |
- name: Update Git Tag | |
run: | | |
git tag -f Pre-release | |
git push -f origin Pre-release | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
prerelease: true | |
allowUpdates: true | |
removeArtifacts: true | |
replacesArtifacts: false | |
tag: Pre-release | |
artifacts: "dist/*.zip" |