2021-07-14 11:02:57 +00:00
|
|
|
name: Nintendo Switch CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ${{ matrix.config.name }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: devkitpro/devkita64:latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
config:
|
2021-08-20 17:57:20 +00:00
|
|
|
- {name: standalone, destDir: switch}
|
2021-07-14 11:02:57 +00:00
|
|
|
- {name: libretro, cmakeArgs: -DLIBRETRO=ON}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: CMake
|
|
|
|
run: |
|
2021-08-11 22:04:46 +00:00
|
|
|
$DEVKITPRO/portlibs/switch/bin/aarch64-none-elf-cmake -B build -DCMAKE_BUILD_TYPE=Release ${{ matrix.config.cmakeArgs }}
|
2021-07-14 11:02:57 +00:00
|
|
|
cmake --build build --config Release --parallel 2
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: flycast-switch-${{ matrix.config.name }}
|
|
|
|
path: build/artifact
|
|
|
|
|
2021-08-20 17:57:20 +00:00
|
|
|
- name: Package app
|
|
|
|
run: |
|
|
|
|
cd build/artifact
|
|
|
|
zip flycast.nro.zip flycast.nro
|
|
|
|
rm -f flycast.nro
|
2021-08-22 18:41:02 +00:00
|
|
|
if: matrix.config.destDir != ''
|
2021-08-20 17:57:20 +00:00
|
|
|
|
2021-08-22 19:00:58 +00:00
|
|
|
- name: Set up git vars
|
|
|
|
run: |
|
|
|
|
echo GIT_BUILD=`git describe --all --always | sed 's/remotes\/origin/heads/'`-$GITHUB_SHA >> $GITHUB_ENV
|
|
|
|
shell: bash
|
|
|
|
|
2021-08-20 17:57:20 +00:00
|
|
|
- name: Configure AWS Credentials
|
|
|
|
id: aws-credentials
|
|
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
|
|
with:
|
|
|
|
aws-access-key-id: AKIAJOZQS4H2PHQWYFCA
|
|
|
|
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
|
|
|
|
aws-region: us-east-2
|
|
|
|
if: github.repository == 'flyinghead/flycast' && github.event_name == 'push' && matrix.config.destDir != ''
|
|
|
|
|
|
|
|
- name: Upload to S3
|
|
|
|
run: aws s3 sync build/artifact s3://flycast-builds/${{ matrix.config.destDir }}/${{ env.GIT_BUILD }} --acl public-read --follow-symlinks
|
|
|
|
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
|