From 3b07d248e4299c1063955d436b5f05816ef31dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20Dragomireck=C3=BD?= Date: Fri, 3 Dec 2021 00:52:35 +0100 Subject: [PATCH] Build MacOS version on Github (#98) * Build MacOS binaries from GitHub workflows --- .github/workflows/build.yml | 103 +++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48157e0395..e3761cd21a 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 @@ -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 @@ -174,7 +176,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 +184,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 @@ -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