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 shell : bash
run: | run: |
cd ./starlight_patch_100/ cd ./starlight_patch_100/
zip -rmT9 ${{ inputs.filename }}.zip ./* zip -rmT9 "${{ inputs.filename }}.zip" ./*
- -
name : Attach to release name : Attach to release
uses : actions/upload-release-asset@v1 uses : actions/upload-release-asset@v1
@ -36,5 +36,10 @@ runs:
with: with:
upload_url : ${{ inputs.upload_url }} upload_url : ${{ inputs.upload_url }}
asset_path : ./starlight_patch_100/${{ inputs.filename }}.zip asset_path : ./starlight_patch_100/${{ inputs.filename }}.zip
asset_name : ${{ inputs.filename }}.zip asset_name : "${{ inputs.filename }}.zip"
asset_content_type : application/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' description : 'filename prefix'
required : false required : false
default : '' default : ''
emu:
description : 'what system the build is for, Switch or Emulators'
required : false
default : 'Switch'
outputs: outputs:
@ -28,7 +32,7 @@ runs:
run: | run: |
VERS=${{ inputs.tag }} VERS=${{ inputs.tag }}
echo "::set-output name=version::${VERS:1}" 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 name : Set up Docker Buildx
uses : docker/setup-buildx-action@v2 uses : docker/setup-buildx-action@v2
@ -49,9 +53,10 @@ runs:
name : Build mod name : Build mod
shell : bash shell : bash
run: | run: |
docker run --rm \ docker run --rm \
-u `id -u`:`id -g` \ -u `id -u`:`id -g` \
-v "/$PWD/":/app/ \ -v "/$PWD/":/app/ \
-e ISEMU=${{ (inputs.emu == 'Emulators' && '1') || '0' }} \
${{ (steps.env.outputs.version != '' && format('-e BUILDVER={0}', steps.env.outputs.version)) || '' }} \ ${{ (steps.env.outputs.version != '' && format('-e BUILDVER={0}', steps.env.outputs.version)) || '' }} \
smoo-build-env \ smoo-build-env \
; ;

View file

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

View file

@ -19,9 +19,13 @@ concurrency:
jobs: jobs:
build: build:
strategy:
matrix:
emu : [ Switch, Emulators ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
filename: ${{ steps.build.outputs.filename }} filename1: ${{ steps.set-output.outputs.filename-Switch }}
filename2: ${{ steps.set-output.outputs.filename-Emulators }}
steps: steps:
- -
name : Checkout name : Checkout
@ -38,6 +42,13 @@ jobs:
uses : ./.github/actions/build uses : ./.github/actions/build
with: with:
prefix : ${{ steps.env.outputs.prefix }} 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: attach:
needs: build 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` 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" echo "::set-output name=upload_url::$url"
- -
name : Attach build artifacts to release name : Attach build artifacts to release (Switch)
uses : ./.github/actions/attach uses : ./.github/actions/attach
with: 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 }} upload_url : ${{ steps.release.outputs.upload_url }}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}

View file

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

View file

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