diff --git a/.github/workflows/buildReleaseInclDocker.yml b/.github/workflows/buildReleaseInclDocker.yml index 5ac0481..410a60c 100644 --- a/.github/workflows/buildReleaseInclDocker.yml +++ b/.github/workflows/buildReleaseInclDocker.yml @@ -27,6 +27,12 @@ env: on: workflow_dispatch: inputs: + draft: + description: "Mark this as a draft release" + type: choice + options: + - 'false' + - 'true' force: description: "Force build even if build already successfully completed for this commit" type: choice @@ -45,6 +51,11 @@ on: description: "'True' if maiko build completed successully" value: ${{ jobs.complete.outputs.build_successful }} inputs: + draft: + description: "Mark this as a draft release" + required: false + type: string + default: 'false' force: description: "Force build even if build already successfully completed for this commit" required: false @@ -60,7 +71,8 @@ defaults: # 1. Linux: Build/push a multiplatform Linux Docker image and use results to # build/push Linux release assets. # -# 2. MacOs_x86_64: Build maiko for MacOS on X86_64 then create and push release assets. +# 2. MacOs: Build maiko for MacOS (x86_64, aarch64, and universal) then create +# and push release assets. # jobs: @@ -73,13 +85,20 @@ jobs: inputs: runs-on: ubuntu-latest outputs: - force: ${{ steps.force.outputs.force }} + draft: ${{ steps.one.outputs.draft }} + force: ${{ steps.one.outputs.force }} steps: - - id: force + - id: one run: > if [ '${{ toJSON(inputs) }}' = 'null' ]; - then echo ::set-output name=force::'${{ github.event.inputs.force }}'; echo "workflow_dispatch"; - else echo ::set-output name=force::'${{ inputs.force }}'; echo "workflow_call"; + then + echo "workflow_dispatch"; + echo "draft=${{ github.event.inputs.draft }}" >> $GITHUB_OUTPUT; + echo "force=${{ github.event.inputs.force }}" >> $GITHUB_OUTPUT; + else + echo "workflow_call"; + echo "draft=${{ inputs.draft }}" >> $GITHUB_OUTPUT; + echo "force=${{ inputs.force }}" >> $GITHUB_OUTPUT; fi @@ -234,7 +253,7 @@ jobs: # Push Release to github - name: Push the release - uses: ncipollo/release-action@v1.8.10 + uses: ncipollo/release-action@v1 with: allowUpdates: true artifacts: @@ -242,22 +261,22 @@ jobs: /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.aarch64.tgz, /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.armv7l.tgz tag: ${{ steps.tag.outputs.release_tag }} - draft: true + draft: ${{ needs.inputs.outputs.draft }} token: ${{ secrets.GITHUB_TOKEN }} ###################################################################################### - # MacOS: build for MacOS (X86_64) and use results to + # MacOS: build for MacOS (x86_64, aarch64, universal) and use results to # create and push release assets to github - macos_x86_64: + macos: needs: [inputs, sentry] if: | needs.sentry.outputs.release_not_built == 'true' || needs.inputs.outputs.force == 'true' - runs-on: macos-10.15 + runs-on: macos-latest steps: @@ -287,8 +306,20 @@ jobs: - name: Build working-directory: ./bin run: | + export LDEARCH=x86_64 ./makeright x ./makeright init + export LDEARCH=aarch64 + ./makeright x + ./makeright init + mkdir -p ../darwin.universal + for exe in ldeinit lde ldex + do + lipo -create \ + -arch arm64 ../darwin.aarch64/$exe} \ + -arch x86_64 ../darwin.x86_64/${exe} \ + -output ../darwin.universal/${exe} + done # Create release tar for github. - name: Make release tar(s) @@ -296,25 +327,29 @@ jobs: RELEASE_TAG: ${{ steps.tag.outputs.release_tag }} run: | mkdir -p /tmp/release_tars - pushd ${GITHUB_WORKSPACE}/../ >/dev/null - tar -c -z \ - -f /tmp/release_tars/${RELEASE_TAG}-darwin.x86_64.tgz \ - maiko/bin/osversion \ - maiko/bin/machinetype \ - maiko/bin/config.guess \ - maiko/bin/config.sub \ - maiko/darwin.x86_64/lde* - popd >/dev/null + cd ${GITHUB_WORKSPACE}/../ + for arch in x86_64 aarch64 universal + do + tar -c -z \ + -f /tmp/release_tars/${RELEASE_TAG}-darwin.${arch}.tgz \ + maiko/bin/osversion \ + maiko/bin/machinetype \ + maiko/bin/config.guess \ + maiko/bin/config.sub \ + maiko/darwin.${arch}/lde* + done # Push Release - name: Push the release - uses: ncipollo/release-action@v1.8.10 + uses: ncipollo/release-action@v1 with: allowUpdates: true artifacts: - /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-darwin.x86_64.tgz + /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-darwin.x86_64.tgz, + /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-darwin.aarch64.tgz, + /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-darwin.universal.tgz tag: ${{ steps.tag.outputs.release_tag }} - draft: true + draft: ${{ needs.inputs.outputs.draft }} token: ${{ secrets.GITHUB_TOKEN }} @@ -331,7 +366,7 @@ jobs: outputs: build_successful: ${{ steps.output.outputs.build_successful }} - needs: [inputs, sentry, linux, macos_x86_64] + needs: [inputs, sentry, linux, macos] steps: # Checkout the actions for this repo owner diff --git a/.gitignore b/.gitignore index e809c7c..e5e23cf 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ cmake-build-*/** *.aarch64-x/** *.aarch64/** init.386/** +*.universal/** # core files core *.core diff --git a/bin/makefile-darwin.aarch64-x b/bin/makefile-darwin.aarch64-x index 0d513bd..f8948a0 100644 --- a/bin/makefile-darwin.aarch64-x +++ b/bin/makefile-darwin.aarch64-x @@ -1,6 +1,6 @@ # Options for MacOS, arm64 (aka aarch64) processor, X windows -CC = clang -target arm64-apple-darwin13 $(CLANG_CFLAGS) +CC = clang -target aarch64-apple-darwin $(CLANG_CFLAGS) XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xbbt.o \ diff --git a/bin/makefile-darwin.x86_64-x b/bin/makefile-darwin.x86_64-x index 46cad50..54d61d4 100644 --- a/bin/makefile-darwin.x86_64-x +++ b/bin/makefile-darwin.x86_64-x @@ -1,6 +1,6 @@ # Options for MacOS, x86 processor, X windows -CC = clang -target x86_64-apple-darwin13 $(CLANG_CFLAGS) +CC = clang -target x86_64-apple-darwin $(CLANG_CFLAGS) XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xbbt.o \ diff --git a/bin/makefile-init-darwin.aarch64 b/bin/makefile-init-darwin.aarch64 index 9a51ad1..65cdfb3 100644 --- a/bin/makefile-init-darwin.aarch64 +++ b/bin/makefile-init-darwin.aarch64 @@ -1,6 +1,6 @@ # Options for MacOS, aarch64 processor, X windows, for INIT processing -CC = clang -target arm64-apple-darwin13 $(CLANG_CFLAGS) +CC = clang -target aarch64-apple-darwin $(CLANG_CFLAGS) XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xbbt.o \ diff --git a/bin/makefile-init-darwin.x86_64 b/bin/makefile-init-darwin.x86_64 index f8f205c..71288cf 100644 --- a/bin/makefile-init-darwin.x86_64 +++ b/bin/makefile-init-darwin.x86_64 @@ -1,6 +1,6 @@ # Options for MacOS, x86_64 processor, X windows, for INIT processing -CC = clang -m64 -target x86_64-apple-darwin13 $(CLANG_CFLAGS) +CC = clang -m64 -target x86_64-apple-darwin $(CLANG_CFLAGS) XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xbbt.o \ diff --git a/bin/makeright b/bin/makeright index 0bbb5d0..1fde522 100755 --- a/bin/makeright +++ b/bin/makeright @@ -54,36 +54,9 @@ if test $# -gt 0 shift fi -target_arch="$1" - -if test $# -gt 0 - then - shift -fi - architecture=`machinetype` osversion=`osversion` - -if test "$target_arch" != "" - then - if test "$osversion" != "darwin" - then - echo "!!!!!!!!!! WARNING: target architecture applies only to the Darwin (MacOS) platform" - echo "!!!!!!!!!! Ignoring target architecture argument: $target_arch" - elif test "$target_arch" = "x86_64" - then - architecture=$target_arch - elif test "$target_arch" = "aarch64" - then - architecture=$target_arch - else - echo "!!!!!!!!! WARNING: Unknown target architecture: $target_arch" - echo "!!!!!!!!! Ignoring second argument." - fi -fi - echo "making so far for ${osversion} on ${architecture}." - case "$display" in init) display=single releasename=init-${osversion}.${architecture}