mirror of
https://github.com/vanilla-wiiu/vanilla.git
synced 2026-10-28 18:02:48 +00:00
134 lines
4.9 KiB
YAML
134 lines
4.9 KiB
YAML
name: Build
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- 'README.md'
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'README.md'
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- os: linux
|
|
arch: x86_64
|
|
artifact: vanilla-linux-x86_64.tar.gz
|
|
- os: linux
|
|
arch: aarch64
|
|
artifact: vanilla-linux-aarch64.tar.gz
|
|
- os: windows
|
|
arch: x86_64
|
|
artifact: vanilla-windows-x86_64.zip
|
|
- os: android
|
|
arch: universal
|
|
artifact: vanilla-android-universal.apk
|
|
- os: macos
|
|
arch: universal
|
|
artifact: vanilla-macos-universal.zip
|
|
- os: raspberrypi0w
|
|
arch: armv6l
|
|
artifact: vanilla-raspberrypi0w-image.zip
|
|
- os: raspberrypi64
|
|
arch: aarch64
|
|
artifact: vanilla-raspberrypi64-image.zip
|
|
- os: orangepi_zero2w
|
|
arch: aarch64
|
|
artifact: vanilla-orangepi_zero2w-image.zip
|
|
- os: orangepi_zero3
|
|
arch: aarch64
|
|
artifact: vanilla-orangepi_zero3-image.zip
|
|
- os: nintendoswitch
|
|
arch: aarch64
|
|
artifact: vanilla-nintendoswitch-image.zip
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies for cross-compiling
|
|
if: ${{ matrix.platform.arch != 'x86_64' && matrix.platform.os == 'linux' }}
|
|
run: sudo apt -y update && sudo apt -y install qemu-user-static binfmt-support
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Registry cache reference
|
|
id: cache
|
|
shell: bash
|
|
run: |
|
|
owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
|
|
echo "ref=ghcr.io/$owner/vanilla-${{ matrix.platform.os }}-${{ matrix.platform.arch }}:buildcache" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: docker/${{ matrix.platform.os }}/Dockerfile
|
|
build-args: |
|
|
ARCH=${{ matrix.platform.arch }}
|
|
tags: vanilla-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
|
|
load: true
|
|
cache-from: type=registry,ref=${{ steps.cache.outputs.ref }}
|
|
cache-to: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'vanilla-wiiu/vanilla') && format('type=registry,ref={0},mode=max', steps.cache.outputs.ref) || '' }}
|
|
|
|
- name: Run Docker container
|
|
run: |
|
|
docker run \
|
|
-v "${{ github.workspace }}:/vanilla" \
|
|
-v "${{ github.workspace }}/build:/install" \
|
|
vanilla-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
|
|
|
|
- name: Archive (Linux)
|
|
if: ${{ matrix.platform.os == 'linux' }}
|
|
run: |
|
|
tar czf ${{ matrix.platform.artifact }} -C "${{ github.workspace }}/build" .
|
|
|
|
- name: Archive (Windows/macOS/Raspberry Pi/Nintendo Switch)
|
|
if: ${{ matrix.platform.os == 'windows' || matrix.platform.os == 'macos' || matrix.platform.os == 'raspberrypi0w' || matrix.platform.os == 'raspberrypi64' || matrix.platform.os == 'nintendoswitch' || matrix.platform.os == 'orangepi_zero3' || matrix.platform.os == 'orangepi_zero2w' }}
|
|
run: |
|
|
cd build
|
|
zip -r ../${{ matrix.platform.artifact }} .
|
|
|
|
- name: Archive (Android)
|
|
if: ${{ matrix.platform.os == 'android' }}
|
|
run: |
|
|
if [ -n "${{ secrets.ANDROID_SIGNING_KEY }}" ]; then
|
|
docker run \
|
|
-v "${{ github.workspace }}:/vanilla" \
|
|
-v "${{ github.workspace }}/build:/install" \
|
|
--entrypoint apksigner \
|
|
vanilla-${{ matrix.platform.os }}-${{ matrix.platform.arch }} \
|
|
sign --ks /vanilla/docker/android/vanilla.jks --out /install/app-release-signed.apk --ks-pass pass:${{ secrets.ANDROID_SIGNING_KEY }} /install/app-release.apk
|
|
cp build/app-release-signed.apk ${{ matrix.platform.artifact }}
|
|
else
|
|
cp build/app-release.apk ${{ matrix.platform.artifact }}
|
|
fi
|
|
|
|
- name: Upload a Build Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.platform.os }} ${{ matrix.platform.arch }}
|
|
path: ${{ matrix.platform.artifact }}
|
|
|
|
- name: Upload Continuous Release
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'vanilla-wiiu/vanilla' }}
|
|
shell: bash
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
curl -fLOSs --retry 2 --retry-delay 60 https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
|
bash upload.sh ${{ matrix.platform.artifact }}
|
|
|