|
| 1 | +name: ALE Psych Builds |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + name: Build ${{ matrix.platform }} |
| 10 | + permissions: write-all |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + container: ${{ matrix.container }} |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + - platform: Nintendo Switch |
| 18 | + os: ubuntu-latest |
| 19 | + container: devkitpro/devkita64:latest |
| 20 | + haxe_setup: | |
| 21 | + sudo apt-get update |
| 22 | + sudo apt-get install -y wget git neko libgc-dev |
| 23 | + wget https://github.com/HaxeFoundation/haxe/releases/download/4.3.4/haxe-4.3.4-linux64.tar.gz |
| 24 | + mkdir haxe_temp |
| 25 | + tar -xf haxe-4.3.4-linux64.tar.gz -C haxe_temp |
| 26 | + sudo cp -r haxe_temp/haxe_*/* /usr/local/bin/ |
| 27 | + mkdir -p ~/haxelib |
| 28 | + haxelib --always --quiet setup ~/haxelib |
| 29 | + haxelib --global --always --quiet update haxelib |
| 30 | + build_cmd: haxelib run lime build Project.xml switch --app-version="4.0.0-${{ github.run_id}}" -D officialBuild |
| 31 | + extra_libs: | |
| 32 | + dkp-pacman -Sy --noconfirm |
| 33 | + dkp-pacman -S --needed --noconfirm \ |
| 34 | + switch-bzip2 switch-cmake switch-curl switch-flac \ |
| 35 | + switch-freetype switch-glad switch-glm switch-harfbuzz \ |
| 36 | + switch-libdrm_nouveau switch-libjpeg-turbo switch-libmodplug \ |
| 37 | + switch-libogg switch-libopus switch-libpng switch-libvorbis \ |
| 38 | + switch-libvorbisidec switch-libwebp switch-mesa switch-mpg123 \ |
| 39 | + switch-openal-soft switch-opusfile switch-pkg-config switch-sdl2 \ |
| 40 | + switch-sdl2_gfx switch-sdl2_image switch-sdl2_mixer \ |
| 41 | + switch-sdl2_net switch-sdl2_ttf switch-tools switch-zlib \ |
| 42 | + switch-liblua51 |
| 43 | + |
| 44 | + haxelib --always --quiet install format |
| 45 | + haxelib --always --quiet install hxp |
| 46 | + haxelib --always --quiet git lime https://github.com/Slushi-Github/lime-nx.git |
| 47 | + haxelib --always --quiet git hxcpp https://github.com/Slushi-Github/hxcpp-nx.git |
| 48 | + haxelib --always --quiet git hx_libnx https://github.com/Slushi-Github/hx_libnx.git |
| 49 | + pre_build_commands: | |
| 50 | + HXCPP_PATH=$(haxelib libpath hxcpp) |
| 51 | + if [ -d "$HXCPP_PATH/tools/hxcpp" ]; then |
| 52 | + cd "$HXCPP_PATH/tools/hxcpp" |
| 53 | + haxe compile.hxml |
| 54 | + cd - |
| 55 | + else |
| 56 | + echo "::error::Can't change directory to HXCPP" |
| 57 | + fi |
| 58 | + |
| 59 | + haxelib run lime rebuild switch |
| 60 | + artifact_path: export/release/switch/bin/*.nro |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Pull the New Commit |
| 64 | + uses: actions/checkout@v4.1.7 |
| 65 | + |
| 66 | + - name: Setup Haxe |
| 67 | + if: ${{ !matrix.haxe_setup }} |
| 68 | + uses: krdlab/setup-haxe@master |
| 69 | + with: |
| 70 | + haxe-version: 4.3.7 |
| 71 | + |
| 72 | + - name: Custom Haxe Setup |
| 73 | + if: ${{ matrix.haxe_setup }} |
| 74 | + run: ${{ matrix.haxe_setup }} |
| 75 | + |
| 76 | + - name: Install Main Libraries |
| 77 | + run: | |
| 78 | + haxelib --global git hmm https://github.com/ALE-Psych-Crew/hmm |
| 79 | + haxelib --global run hmm setup |
| 80 | + haxelib --global run hmm install |
| 81 | +
|
| 82 | + - name: Install Extra Libraries |
| 83 | + if: ${{ matrix.extra_libs }} |
| 84 | + run: ${{ matrix.extra_libs }} |
| 85 | + |
| 86 | + - name: Pre-Build Commands |
| 87 | + if: ${{ matrix.pre_build_commands }} |
| 88 | + run: ${{ matrix.pre_build_commands }} |
| 89 | + |
| 90 | + - name: Build for ${{ matrix.platform }} |
| 91 | + run: ${{ matrix.build_cmd }} |
| 92 | + |
| 93 | + - name: Upload Game |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: ${{ matrix.platform }} Build |
| 97 | + path: ${{ matrix.artifact_path }} |
| 98 | + if-no-files-found: error |
0 commit comments