name: Build and Publish Release
on: [push]
jobs:
  Compile-3ds:
    runs-on: ubuntu-latest
    outputs:
      3ds_link: ${{ steps.zip.outputs.zip }}
    container:
      image: devkitpro/devkitarm
    steps:
      - uses: actions/checkout@v2
      - name: Install Packages and update picaGL
        run: |
          git clone https://github.com/masterfeizz/picaGL.git
          cd picaGL
          mkdir clean
          CFLAGS=-Wno-error make install
      - name: Build
        working-directory: ./
        run: |
          make -f Makefile
      - name: Zip and Upload
        id: zip
        working-directory: ./
        run: |
          zip -r ctr-nzp-3ds.zip nzportable.3dsx nzportable.smdh
          curl --upload-file ./ctr-nzp-3ds.zip https://transfer.sh/ctr-nzp-3ds.zip > output-log.log
          echo "::set-output name=zip::$(cat output-log.log)"

