cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

gbdk_build_and_package.yml (6744B)


      1name: GBDK Build and Package
      2
      3on:
      4  # Allows you to run this workflow manually from the Actions tab
      5  workflow_dispatch:
      6  # Triggers the workflow on push or pull request events but only for the develop branch
      7  # push:
      8  #   branches: [ develop ]
      9  # pull_request:
     10  #   branches: [ develop ]
     11
     12jobs:
     13  build:
     14    runs-on: ${{ matrix.os }}  
     15    strategy:
     16      matrix:
     17        include:
     18          - os: ubuntu-20.04
     19            name: Linux-x64
     20          - os: macos-10.15
     21            name: MacOS-x64
     22          - os: windows-2019
     23            name: Windows-x64
     24          - os: windows-2019
     25            name: Windows-x32
     26    steps:
     27
     28      # ==== OS Specific Dependencies ====
     29      - name: Linux Depends
     30        if: matrix.name == 'Linux-x64'
     31        run: |
     32          # Use patched sms/gg z80 build:
     33          # For GBDK-2020 4.0.5
     34          # curl -Lo sdcc.tar.bz2 https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-12539-patched/sdcc-amd64-linux2.5-20210711-12539--sms-gg-patched.tar.bz2
     35          # For GBDK-2020 4.0.6
     36          # curl -Lo sdcc.tar.bz2 https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-12539-patched-gbdk0-4.0.6/sdcc-amd64-linux2.5-20211031-12539--sms-gg-patched.tar.bz2
     37          # For GBDK-2020 4.1.0
     38          curl -Lo sdcc.tar.bz2 https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-13350-patched-gbdk-4.1.0/sdcc-amd64-linux2.5-20220402-13350--sdldz80-patched-at-12539.tar.bz2
     39          bunzip2 sdcc.tar.bz2
     40          tar xvf sdcc.tar
     41
     42      - name: MacOS Depends
     43        if: matrix.name == 'MacOS-x64'
     44        run: |
     45          # Use patched sms/gg z80 build:
     46          # For GBDK-2020 4.0.5
     47          # curl -Lo sdcc.tar.bz2 https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-12539-patched/sdcc-x86_64-apple-macosx-20210718-12548--sms-gg-patched.tar.bz2
     48          # For GBDK-2020 4.0.6
     49          # curl -Lo sdcc.tar.bz2 https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-12539-patched-gbdk0-4.0.6/sdcc-x86_64-apple-macosx-20210718-12548--sms-gg-patched.tar.bz2
     50          # For GBDK-2020 4.1.0
     51          curl -Lo sdcc.tar.bz2 https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-13350-patched-gbdk-4.1.0/sdcc-x86_64-apple-macosx-20220402-13350--sdldz80-patched-at-12539.tar.bz2
     52          bunzip2 sdcc.tar.bz2
     53          tar xvf sdcc.tar
     54
     55      - name: Windows-x64 Depends
     56        if: matrix.name == 'Windows-x64'
     57        run: |
     58          # Use patched sms/gg z80 build:
     59          # For GBDK-2020 4.0.5
     60          # curl -Lo sdcc.zip https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-12539-patched/sdcc-x86_64-w64-mingw32-20210711-12539--sms-gg-patched.zip
     61          # For GBDK-2020 4.0.6: adds makebin -yN
     62          # curl -Lo sdcc.zip https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-12539-patched-gbdk0-4.0.6/sdcc-x86_64-w64-mingw32-20210711-12539--sms-gg-patched_makebin_yN.zip
     63          # For GBDK-2020 4.1.0
     64          curl -Lo sdcc.zip https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-13350-patched-gbdk-4.1.0/sdcc-x86_64-w64-mingw32-20220402-13350--sdldz80-patched-at-12539.zip
     65          7z x sdcc.zip
     66
     67      - name: Windows-x32 Depends
     68        if: matrix.name == 'Windows-x32'
     69        run: |
     70          # Use patched sms/gg z80 build:
     71          # For GBDK-2020 4.0.6: adds makebin -yN
     72          # curl -Lo sdcc.zip https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-12539-patched-gbdk0-4.0.6/sdcc-i586-mingw32msvc-20210711-12539--sms-gg-patched_makebin_yN.zip
     73          # For GBDK-2020 4.1.0
     74          curl -Lo sdcc.zip https://github.com/gbdk-2020/gbdk-2020-sdcc/releases/download/sdcc-13350-patched-gbdk-4.1.0/sdcc-i586-mingw32msvc-20220402-13350--sdldz80-patched-at-12539.zip
     75          7z x sdcc.zip
     76
     77      - name: Windows Depends MSYS2/MinGW64
     78        if: matrix.name == 'Windows-x64'
     79        uses: msys2/setup-msys2@v2
     80        with:
     81          msystem: MINGW64
     82          path-type: minimal #strict
     83          release: false
     84          update: false
     85          install: >-
     86            base-devel
     87            mingw-w64-x86_64-toolchain
     88
     89      - name: Windows Depends MSYS2/MinGW32
     90        if: matrix.name == 'Windows-x32'
     91        uses: msys2/setup-msys2@v2
     92        with:
     93          msystem: MINGW32
     94          path-type: minimal #strict
     95          release: false
     96          update: false
     97          install: >-
     98            base-devel
     99            mingw-w64-i686-toolchain
    100
    101      # ==== Build Steps ====
    102      - name: Check out GBDK-2020
    103        uses: actions/checkout@v2
    104        with:
    105          path: gbdk-2020
    106          submodules: false
    107
    108      # ==== Pre-Build: Set environment vars ====
    109      # Needs to be in a separate step than build so that setting the environment var takes effect
    110      #
    111      - name: Pre-Build Linux/MacOS
    112        if: (matrix.name == 'Linux-x64') || (matrix.name == 'MacOS-x64')
    113        shell: bash
    114        run: |
    115          echo "BUILD_PACKAGE_FILENAME=gbdk-2020-${{ matrix.name }}.tar.gz" >> $GITHUB_ENV
    116
    117      - name: Pre-Build Windows
    118        if: (matrix.name == 'Windows-x64') || (matrix.name == 'Windows-x32')
    119        shell: bash
    120        run: |
    121          echo "BUILD_PACKAGE_FILENAME=gbdk-2020-${{ matrix.name }}.zip" >> $GITHUB_ENV
    122
    123      # ==== Builds ====
    124      - name: Build GBDK-2020 Linux/MacOS
    125        if: (matrix.name == 'Linux-x64') || (matrix.name == 'MacOS-x64')
    126        shell: bash
    127        run: |
    128          export SDCCDIR=`pwd`/sdcc
    129          cd gbdk-2020
    130          make
    131          cd ..
    132
    133      - name: Build GBDK-2020 Windows
    134        if: (matrix.name == 'Windows-x64') || (matrix.name == 'Windows-x32')
    135        shell: cmd
    136        run: |
    137          set SDCCDIR=%CD%\sdcc
    138          cd gbdk-2020
    139          msys2 -c 'make'
    140          cd ..
    141
    142      # ==== Packaging ====
    143      - name: Package build Linux/MacOS
    144        if: (matrix.name == 'Linux-x64') || (matrix.name == 'MacOS-x64')
    145        shell: bash
    146        run: |
    147          cd gbdk-2020
    148          mkdir package
    149          cd build
    150          tar czf ../package/${{ env.BUILD_PACKAGE_FILENAME }} gbdk
    151          cd ..
    152          cd ..
    153
    154      - name: Package build Windows
    155        if: (matrix.name == 'Windows-x64') || (matrix.name == 'Windows-x32')
    156        shell: cmd
    157        run: |
    158          cd gbdk-2020
    159          mkdir package
    160          cd build
    161          7z a ../package/${{ env.BUILD_PACKAGE_FILENAME }} gbdk
    162          cd ..
    163          cd ..
    164
    165      - name: Store build
    166        if: (matrix.name == 'Linux-64') || (matrix.name == 'MacOS-64') || ('Windows-x64') || ('Windows-x32')
    167        uses: actions/upload-artifact@v2
    168        with:
    169          name: ${{ matrix.name }} build
    170          path: gbdk-2020/package/${{ env.BUILD_PACKAGE_FILENAME }}
    171          # retention-days: 14