Merge pull request #35 from Istador/emu-build

separate build for emulators
This commit is contained in:
CraftyBoss 2022-09-04 20:11:38 -07:00 committed by GitHub
commit 13c873aae0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 12 deletions

View file

@ -27,7 +27,7 @@ runs:
shell : bash
run: |
cd ./starlight_patch_100/
zip -rmT9 ${{ inputs.filename }}.zip ./*
zip -rmT9 "${{ inputs.filename }}.zip" ./*
-
name : Attach to release
uses : actions/upload-release-asset@v1
@ -36,5 +36,10 @@ runs:
with:
upload_url : ${{ inputs.upload_url }}
asset_path : ./starlight_patch_100/${{ inputs.filename }}.zip
asset_name : ${{ inputs.filename }}.zip
asset_name : "${{ inputs.filename }}.zip"
asset_content_type : application/zip
-
name : Cleanup artifacts
shell : bash
run: |
rm -rf ./starlight_patch_100/

View file

@ -10,6 +10,10 @@ inputs:
description : 'filename prefix'
required : false
default : ''
emu:
description : 'what system the build is for, Switch or Emulators'
required : false
default : 'Switch'
outputs:
@ -28,7 +32,7 @@ runs:
run: |
VERS=${{ inputs.tag }}
echo "::set-output name=version::${VERS:1}"
echo "::set-output name=filename::${{ inputs.prefix }}SMO_Online${{ (inputs.tag != '' && format('_{0}', inputs.tag)) || '' }}"
echo "::set-output name=filename::${{ inputs.prefix }}SMO_Online${{ (inputs.tag != '' && format('_{0}', inputs.tag)) || '' }}_for_${{ inputs.emu }}"
-
name : Set up Docker Buildx
uses : docker/setup-buildx-action@v2
@ -49,9 +53,10 @@ runs:
name : Build mod
shell : bash
run: |
docker run --rm \
-u `id -u`:`id -g` \
-v "/$PWD/":/app/ \
docker run --rm \
-u `id -u`:`id -g` \
-v "/$PWD/":/app/ \
-e ISEMU=${{ (inputs.emu == 'Emulators' && '1') || '0' }} \
${{ (steps.env.outputs.version != '' && format('-e BUILDVER={0}', steps.env.outputs.version)) || '' }} \
smoo-build-env \
;

View file

@ -20,6 +20,9 @@ on:
jobs:
build:
strategy:
matrix:
emu : [ Switch, Emulators ]
runs-on: ubuntu-latest
steps:
-
@ -28,3 +31,5 @@ jobs:
-
name : Build artifacts
uses : ./.github/actions/build
with:
emu : ${{ matrix.emu }}

View file

@ -19,9 +19,13 @@ concurrency:
jobs:
build:
strategy:
matrix:
emu : [ Switch, Emulators ]
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.build.outputs.filename }}
filename1: ${{ steps.set-output.outputs.filename-Switch }}
filename2: ${{ steps.set-output.outputs.filename-Emulators }}
steps:
-
name : Checkout
@ -38,6 +42,13 @@ jobs:
uses : ./.github/actions/build
with:
prefix : ${{ steps.env.outputs.prefix }}
emu : ${{ matrix.emu }}
-
name : Set output
id : set-output
shell : bash
run : |
echo "::set-output name=filename-${{ matrix.emu }}::${{ steps.build.outputs.filename }}"
attach:
needs: build
@ -54,10 +65,17 @@ jobs:
url=`curl -sS --fail ${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/${{ env.TAG }} | jq .upload_url -r`
echo "::set-output name=upload_url::$url"
-
name : Attach build artifacts to release
name : Attach build artifacts to release (Switch)
uses : ./.github/actions/attach
with:
filename : ${{ needs.build.outputs.filename }}
filename : ${{ needs.build.outputs.filename1 }}
upload_url : ${{ steps.release.outputs.upload_url }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
-
name : Attach build artifacts to release (Emulators)
uses : ./.github/actions/attach
with:
filename : ${{ needs.build.outputs.filename2 }}
upload_url : ${{ steps.release.outputs.upload_url }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}

View file

@ -12,9 +12,13 @@ on:
jobs:
build:
strategy:
matrix:
emu : [ Switch, Emulators ]
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.build.outputs.filename }}
filename1: ${{ steps.set-output.outputs.filename-Switch }}
filename2: ${{ steps.set-output.outputs.filename-Emulators }}
steps:
-
name : Checkout
@ -25,6 +29,13 @@ jobs:
uses : ./.github/actions/build
with:
tag : ${{ github.ref_name }}
emu : ${{ matrix.emu }}
-
name : Set output
id : set-output
shell : bash
run : |
echo "::set-output name=filename-${{ matrix.emu }}::${{ steps.build.outputs.filename }}"
release:
needs: build
@ -41,9 +52,16 @@ jobs:
tag : ${{ github.ref_name }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
-
name : Attach build artifacts to release
name : Attach build artifacts to release (Switch)
uses : ./.github/actions/attach
with:
filename : ${{ needs.build.outputs.filename }}
filename : ${{ needs.build.outputs.filename1 }}
upload_url : ${{ steps.release.outputs.upload_url }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
-
name : Attach build artifacts to release (Emulators)
uses : ./.github/actions/attach
with:
filename : ${{ needs.build.outputs.filename2 }}
upload_url : ${{ steps.release.outputs.upload_url }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,10 +1,13 @@
#!/bin/bash
ISEMU=${1:-0}
export DOCKER_BUILDKIT=1
docker build . -t smoo-client-build
docker run --rm \
-u $(id -u):$(id -g) \
-v "/$PWD/":/app/ \
-e ISEMU=${ISEMU} \
smoo-client-build \
;
docker rmi smoo-client-build