From cb2fc572c199897ac98c0ade9bf15c9eb08fe57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20Dragomirecky=CC=81?= Date: Thu, 2 Dec 2021 23:16:52 +0100 Subject: [PATCH 1/2] github: Specify repository as a template variable --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48157e0395..d6484d3565 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v2.2.0 if: ${{ github.event.pull_request }} with: - repository: vintagepc/MINI404.git + repository: ${{ github.repository }} ref: ${{ github.event.pull_request.head.sha }} submodules: false @@ -34,7 +34,7 @@ jobs: uses: actions/checkout@v2.2.0 if: ${{ !github.event.pull_request }} with: - repository: vintagepc/MINI404.git + repository: ${{ github.repository }} ref: ${{ github.event.ref }} submodules: false @@ -174,7 +174,7 @@ jobs: uses: actions/checkout@v2.2.0 if: ${{ github.event.pull_request }} with: - repository: vintagepc/MINI404.git + repository: ${{ github.repository }} ref: ${{ github.event.pull_request.head.sha }} submodules: false @@ -182,7 +182,7 @@ jobs: uses: actions/checkout@v2.2.0 if: ${{ !github.event.pull_request }} with: - repository: vintagepc/MINI404.git + repository: ${{ github.repository }} ref: ${{ github.event.ref }} submodules: false From bebe6d94ee37ceabdab18b51ea9e25cecd1c6427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20Dragomirecky=CC=81?= Date: Thu, 2 Dec 2021 23:17:21 +0100 Subject: [PATCH 2/2] github: Build MacOS binaries from GitHub workflows --- .github/workflows/build.yml | 95 ++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6484d3565..e3761cd21a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,49 +96,51 @@ jobs: name: Binaries path: ${{ runner.workspace }}/MINI404/build/Mini404-dev-linux.tar.bz2 - # build_osx: - # # The type of runner that the job will run on - # runs-on: macos-latest - # if: "!contains(github.event.head_commit.message, 'NO_BUILD')" - # # Steps represent a sequence of tasks that will be executed as part of the job - # steps: - # # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - # - name: Checkout ${{ github.event.pull_request.head.ref }} - # uses: actions/checkout@v2.2.0 - # if: ${{ github.event.pull_request }} - # with: - # repository: vintagepc/MK404.git - # ref: ${{ github.event.pull_request.head.sha }} - # submodules: true - - # - name: Checkout ${{ github.event.ref }} - # uses: actions/checkout@v2.2.0 - # if: ${{ !github.event.pull_request }} - # with: - # repository: vintagepc/MK404.git - # ref: ${{ github.event.ref }} - # submodules: true - - # - name: Install packages - # run: | - # brew cask install xquartz - # brew tap osx-cross/avr - # brew install libelf freeglut glew SDL avr-gcc libpng - - # - name: Prepare CMake build - # run: mkdir ${{ runner.workspace }}/MK404/build && cd ${{ runner.workspace }}/MK404/build && cmake -DCMAKE_BUILD_TYPE=RELEASE .. - - # - name: Build Einsy - # run: | - # cd ${{ runner.workspace }}/MK404/build && make -j2 - # cp MK404 MK404_OSX - - # - name: Upload OSX artifact - # if: ${{ !github.event.pull_request }} - # uses: actions/upload-artifact@v2 - # with: - # name: Binaries - # path: ${{ runner.workspace }}/MK404/build/MK404_OSX + build_macos: + # The type of runner that the job will run on + runs-on: macos-latest + if: "!contains(github.event.head_commit.message, 'NO_BUILD')" + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout ${{ github.event.pull_request.head.ref }} + uses: actions/checkout@v2.2.0 + if: ${{ github.event.pull_request }} + with: + repository: ${{ github.repository }} + ref: ${{ github.event.pull_request.head.sha }} + submodules: true + + - name: Checkout ${{ github.event.ref }} + uses: actions/checkout@v2.2.0 + if: ${{ !github.event.pull_request }} + with: + repository: ${{ github.repository }} + ref: ${{ github.event.ref }} + submodules: true + + - name: Install dependencies + run: brew install libffi gettext glib pkg-config autoconf automake pixman ninja make + + - name: Configure build + run: cd ${{ runner.workspace }}/MINI404 && ./configure --target-list="buddy-softmmu" + + - name: Build qemu-system-buddy + run: cd ${{ runner.workspace }}/MINI404 && gmake -j3 + + - name: Assemble artifacts + if: ${{ !github.event.pull_request }} + run: | + cd ${{ runner.workspace }}/MINI404/build + mv buddy-softmmu Mini404-dev-macos + tar -jhcvf Mini404-dev-macos.tar.bz2 Mini404-dev-macos + + - name: Upload artifact + if: ${{ !github.event.pull_request }} + uses: actions/upload-artifact@v2 + with: + name: Binaries + path: ${{ runner.workspace }}/MINI404/build/Mini404-dev-macos.tar.bz2 build_cygwin: # The type of runner that the job will run on @@ -231,7 +233,7 @@ jobs: Publish: runs-on: ubuntu-latest if: ${{ !github.event.pull_request }} - needs: [build_linux, build_cygwin] + needs: [build_linux, build_cygwin, build_macos] steps: - name: Retrieve platform binaries uses: actions/download-artifact@v2 @@ -247,10 +249,13 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') run: | tar -jxvf Mini404-dev-linux.tar.bz2 + tar -jxvf Mini404-dev-macos.tar.bz2 unzip Mini404-dev-w64.zip mv Mini404-dev-linux Mini404-${{ steps.get_version.outputs.VERSION }}-linux + mv Mini404-dev-macos Mini404-${{ steps.get_version.outputs.VERSION }}-macos mv Mini404-dev-w64 Mini404-${{ steps.get_version.outputs.VERSION }}-w64 tar -jcvf Mini404-${{ steps.get_version.outputs.VERSION }}-linux.tar.bz2 Mini404-${{ steps.get_version.outputs.VERSION }}-linux + tar -jcvf Mini404-${{ steps.get_version.outputs.VERSION }}-macos.tar.bz2 Mini404-${{ steps.get_version.outputs.VERSION }}-macos zip -r Mini404-${{ steps.get_version.outputs.VERSION }}-w64.zip Mini404-${{ steps.get_version.outputs.VERSION }}-w64 - name: RELEASE THE KRAKEN @@ -261,6 +266,7 @@ jobs: prerelease: false files: | Mini404-${{ steps.get_version.outputs.VERSION }}-linux.tar.bz2 + Mini404-${{ steps.get_version.outputs.VERSION }}-macos.tar.bz2 Mini404-${{ steps.get_version.outputs.VERSION }}-w64.zip - name: Publish prerelease @@ -273,5 +279,6 @@ jobs: title: "Latest (Development) Build" files: | Mini404-dev-linux.tar.bz2 + Mini404-dev-macos.tar.bz2 Mini404-dev-w64.zip