From 59f2f2e835e989883ba57de93bc3e15515bee28f Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 6 Jun 2023 16:32:44 -0700 Subject: [PATCH 1/5] Updated maiko build workflows to be mch more efficient incl. sing Apline Lnux to do the builds; also removed the Maiko docker image since it no longer makes sense --- .github/workflows/Dockerfile_builder | 18 + .github/workflows/Dockerfile_maiko | 22 + .github/workflows/buildBuilderImage.yml | 18 +- .github/workflows/buildRelease.yml | 59 +-- .github/workflows/buildReleaseInclDocker.yml | 430 ------------------- .gitignore | 3 + Dockerfile | 55 --- 7 files changed, 66 insertions(+), 539 deletions(-) create mode 100755 .github/workflows/Dockerfile_builder create mode 100755 .github/workflows/Dockerfile_maiko delete mode 100644 .github/workflows/buildReleaseInclDocker.yml delete mode 100644 Dockerfile diff --git a/.github/workflows/Dockerfile_builder b/.github/workflows/Dockerfile_builder new file mode 100755 index 0000000..9ed1df0 --- /dev/null +++ b/.github/workflows/Dockerfile_builder @@ -0,0 +1,18 @@ +#******************************************************************************* +# +# Dockerfile to build image with all the tools to build Maiko +# +# Copyright 2023 by Interlisp.org +# +# Frank Halasz 2023-02-21 +# +# ****************************************************************************** + +FROM ubuntu:latet +SHELL ["/bin/bash", "-c"] +USER root:root +# Install build tools +RUN apt-get update && apt-get install -y make clang libx11-dev gcc +USER root +WORKDIR /root +ENTRYPOINT /bin/bash diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko new file mode 100755 index 0000000..f6058fa --- /dev/null +++ b/.github/workflows/Dockerfile_maiko @@ -0,0 +1,22 @@ +#******************************************************************************* +# +# Dockerfile to build Maiko to be used by buildRelease github action +# The output of this is intended to be a directory in the github workspace +# file system it is not intended to be a useable Docker image. +# +# Copyright 2023 by Interlisp.org +# +# Frank Halasz 2023-02-21 +# +# ****************************************************************************** + +FROM ghcr.io/interlisp/maiko-builder +ARG INSTALL_LOCATION=/usr/local/interlisp/maiko +# Copy over / clean maiko repo +COPY . ${INSTALL_LOCATION} +# Build maiko +RUN cd ${INSTALL_LOCATION}/bin \ + && ./makeright x cleanup\ + && ./makeright init cleanup \ + && ./makeright x \ + && ./makeright init diff --git a/.github/workflows/buildBuilderImage.yml b/.github/workflows/buildBuilderImage.yml index c6fea02..369bf1f 100644 --- a/.github/workflows/buildBuilderImage.yml +++ b/.github/workflows/buildBuilderImage.yml @@ -32,15 +32,9 @@ jobs: runs-on: ubuntu-latest steps: - # Checkout just the relevant Dockerfile - - name: Checkout files - uses: Bhacaz/checkout-files@v2 - with: - files: .github/workflows/Dockerfile_builder - - # Checkout the branch of maiko code - #- name: Checkout - # uses: actions/checkout@v3 + # Checkout maiko + - name: Checkout maiko + uses: actions/checkout@v3 # Setup docker environment variables - name: Setup Docker Environment Variables @@ -49,7 +43,7 @@ jobs: DOCKER_REGISTRY="ghcr.io" DOCKER_NAMESPACE=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') DOCKER_REPO=${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}/maiko-builder - DOCKER_TAGS="${DOCKER_REPO}:latest + DOCKER_TAGS="${DOCKER_REPO}:latest" echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV} echo "DOCKER_TAGS=${DOCKER_TAGS}" >> ${GITHUB_ENV} @@ -66,7 +60,7 @@ jobs: # Login to ghcr.io - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -89,5 +83,5 @@ jobs: push: true tags: ${{ env.DOCKER_TAGS }} - + ###################################################################################### diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml index 7cebfac..c4ff2dd 100644 --- a/.github/workflows/buildRelease.yml +++ b/.github/workflows/buildRelease.yml @@ -1,27 +1,24 @@ #******************************************************************************* -# buidReleaseInclDocker.yml +# buidRelease.yml # -# Workflow to build a Maiko release that is pushed to github as well as -# Docker images incorporating the release, which are pushed to Docker Hub. -# For linux: release assets are built/pushed for X86_64, aarch64 and arm7vl and -# a multiplatform Docker image is pushed. -# For macOS: release assets are built/pushed for X86_64. (No aarch64 as yet.) +# Workflow to build a Maiko release that is pushed to github. +# For linux: release assets are built/pushed for X86_64, aarch64 and arm7vl. +# For macOS: release assets are built/pushed for X86_64 and aarch64 as well as +# a set of universal binaries. # For Windows: not supported # # Note release pushed to github automatically includes source code assets # in tar and zip formats. # # 2022-01-16 by Frank Halasz based on earlier workflow called buildDocker.yml +# Updated 2023-06-06: Remove docker image push; increase build efficeincy for linux # -# Copyright 2022 by Interlisp.org +# Copyright 2022-2023 by Interlisp.org # # # ****************************************************************************** -name: 'Build/Push Release & Docker Image' - -env: - workflow: 'buildReleaseInclDocker.yml' +name: 'Build/Push Release # Run this workflow on ... on: @@ -68,8 +65,8 @@ defaults: # 2 separate jobs here that can run in parallel # -# 1. Linux: Build/push a multiplatform Linux Docker image and use results to -# build/push Linux release assets. +# 1. Linux: Build a multiplatform Linux Docker file system (not saved) and use +# results to build/push Linux release assets. # # 2. MacOs: Build maiko for MacOS (x86_64, aarch64, and universal) then create # and push release assets. @@ -176,31 +173,25 @@ jobs: # Setup the Docker Machine Emulation environment. - name: Set up QEMU - uses: docker/setup-qemu-action@master + uses: docker/setup-qemu-action@v2 with: platforms: linux/amd64,linux/arm64,linux/arm/v7 # Setup the Docker Buildx funtion - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@master - - # Login into DockerHub - required to store the created image - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + uses: docker/setup-buildx-action@v2 # Do the Docker Build using the Dockerfile in the repository we - # checked out. Push the result to Docker Hub. + # checked out. Save the results in a directory under /tmp to be used + # for creating release tars. Does not creatre a docker image and does not + # push anything to Docker Hub. # # NOTE: THE ACTUAL MAIKO BUILD (FOR LINUX) HAPPENS HERE - I.E., IN THE # DOCKER BUILD CALL. BUILD COMMANDS ARE SPECIFIED IN THE # Dockerfile, NOT HERE IN THE WORKFLOW. # - - name: Build Docker Image for Push to Docker Hub - if: ${{ true }} + - name: Build Docker Image and Save It Locally uses: docker/build-push-action@v4 with: builder: ${{ steps.buildx.outputs.name }} @@ -208,23 +199,7 @@ jobs: BUILD_DATE=${{ steps.docker_env.outputs.build_time }} RELEASE_TAG=${{ steps.tag.outputs.release_tag }} context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64,linux/arm/v7 - # Push the result to DockerHub - push: true - tags: ${{ steps.docker_env.outputs.docker_tags }} - - # Redo the Docker Build (hopefully mostly using the cache from the previous build). - # But save the results in a directory under /tmp to be used for creating release tars. - - name: Rebuild Docker Image For Saving Locally - uses: docker/build-push-action@v4 - with: - builder: ${{ steps.buildx.outputs.name }} - build-args: | - BUILD_DATE=${{ steps.docker_env.outputs.build_time }} - RELEASE_TAG=${{ steps.tag.outputs.release_tag }} - context: . - file: ./Dockerfile + file: ./.github/workflows/Dockerfile_maiko platforms: linux/amd64,linux/arm64,linux/arm/v7 # Put the results out to the local file system outputs: type=local,dest=/tmp/docker_images diff --git a/.github/workflows/buildReleaseInclDocker.yml b/.github/workflows/buildReleaseInclDocker.yml deleted file mode 100644 index 7cebfac..0000000 --- a/.github/workflows/buildReleaseInclDocker.yml +++ /dev/null @@ -1,430 +0,0 @@ -#******************************************************************************* -# buidReleaseInclDocker.yml -# -# Workflow to build a Maiko release that is pushed to github as well as -# Docker images incorporating the release, which are pushed to Docker Hub. -# For linux: release assets are built/pushed for X86_64, aarch64 and arm7vl and -# a multiplatform Docker image is pushed. -# For macOS: release assets are built/pushed for X86_64. (No aarch64 as yet.) -# For Windows: not supported -# -# Note release pushed to github automatically includes source code assets -# in tar and zip formats. -# -# 2022-01-16 by Frank Halasz based on earlier workflow called buildDocker.yml -# -# Copyright 2022 by Interlisp.org -# -# -# ****************************************************************************** - -name: 'Build/Push Release & Docker Image' - -env: - workflow: 'buildReleaseInclDocker.yml' - -# Run this workflow on ... -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 - options: - - 'false' - - 'true' - - workflow_call: - secrets: - DOCKER_USERNAME: - required: true - DOCKER_PASSWORD: - required: true - outputs: - successful: - 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 - type: string - default: 'false' - -defaults: - run: - shell: bash - -# 2 separate jobs here that can run in parallel -# -# 1. Linux: Build/push a multiplatform Linux Docker image and use results to -# build/push Linux release assets. -# -# 2. MacOs: Build maiko for MacOS (x86_64, aarch64, and universal) then create -# and push release assets. -# - -jobs: - -###################################################################################### - - # Regularize the inputs so they can be referenced the same way whether they are - # the result of a workflow_dispatch or a workflow_call - - inputs: - runs-on: ubuntu-latest - outputs: - draft: ${{ steps.one.outputs.draft }} - force: ${{ steps.one.outputs.force }} - steps: - - id: one - run: > - if [ '${{ toJSON(inputs) }}' = 'null' ]; - 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 - - - -###################################################################################### - - # Use sentry-action to determine if this release has already been built - # based on the latest commit to the repo - - sentry: - needs: inputs - runs-on: ubuntu-latest - outputs: - release_not_built: ${{ steps.check.outputs.release_not_built }} - - steps: - # Checkout the actions for this repo owner - - name: Checkout Actions - uses: actions/checkout@v3 - with: - repository: ${{ github.repository_owner }}/.github - path: ./Actions_${{ github.sha }} - - run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }} - - # Check if build already run for this commit - - name: Build already completed? - id: check - continue-on-error: true - uses: ./../actions/check-sentry-action - with: - tag: "release_docker" - -###################################################################################### - - # Linux: build and push multi-platform docker image for Linux - # Use docker images to create and push release assets to github - - linux: - - needs: [inputs, sentry] - if: | - needs.sentry.outputs.release_not_built == 'true' - || needs.inputs.outputs.force == 'true' - - runs-on: ubuntu-latest - - steps: - # Checkout the actions for this repo owner - - name: Checkout Actions - uses: actions/checkout@v3 - with: - repository: ${{ github.repository_owner }}/.github - path: ./Actions_${{ github.sha }} - - run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }} - - # Checkout the branch - - name: Checkout - uses: actions/checkout@v3 - - # Setup release tag - - name: Setup Release Tag - id: tag - uses: ./../actions/release-tag-action - - # Setup docker environment variables - - name: Setup Docker Environment Variables - id: docker_env - run: | - DOCKER_NAMESPACE=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') - echo "DOCKER_NAMESPACE=${DOCKER_NAMESPACE}" >> ${GITHUB_ENV} - DOCKER_IMAGE=${DOCKER_NAMESPACE}/${{ steps.tag.outputs.repo_name }} - DOCKER_TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${RELEASE_TAG#*-}" - echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - echo "docker_tags=${DOCKER_TAGS}" >> $GITHUB_OUTPUT - - # Setup the Docker Machine Emulation environment. - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: linux/amd64,linux/arm64,linux/arm/v7 - - # Setup the Docker Buildx funtion - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - # Login into DockerHub - required to store the created image - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - # Do the Docker Build using the Dockerfile in the repository we - # checked out. Push the result to Docker Hub. - # - # NOTE: THE ACTUAL MAIKO BUILD (FOR LINUX) HAPPENS HERE - I.E., IN THE - # DOCKER BUILD CALL. BUILD COMMANDS ARE SPECIFIED IN THE - # Dockerfile, NOT HERE IN THE WORKFLOW. - # - - name: Build Docker Image for Push to Docker Hub - if: ${{ true }} - uses: docker/build-push-action@v4 - with: - builder: ${{ steps.buildx.outputs.name }} - build-args: | - BUILD_DATE=${{ steps.docker_env.outputs.build_time }} - RELEASE_TAG=${{ steps.tag.outputs.release_tag }} - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64,linux/arm/v7 - # Push the result to DockerHub - push: true - tags: ${{ steps.docker_env.outputs.docker_tags }} - - # Redo the Docker Build (hopefully mostly using the cache from the previous build). - # But save the results in a directory under /tmp to be used for creating release tars. - - name: Rebuild Docker Image For Saving Locally - uses: docker/build-push-action@v4 - with: - builder: ${{ steps.buildx.outputs.name }} - build-args: | - BUILD_DATE=${{ steps.docker_env.outputs.build_time }} - RELEASE_TAG=${{ steps.tag.outputs.release_tag }} - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64,linux/arm/v7 - # Put the results out to the local file system - outputs: type=local,dest=/tmp/docker_images - tags: ${{ steps.docker_env.outputs.docker_tags }} - - # Use docker results to create releases for github. - # Docker results are in /tmp/docker_images. One subdir for each platform. - - name: Make release tars for each platform - env: - RELEASE_TAG: ${{ steps.tag.outputs.release_tag }} - run: | - mkdir -p /tmp/release_tars - for OSARCH in "linux.x86_64:linux_amd64" "linux.aarch64:linux_arm64" "linux.armv7l:linux_arm_v7" ; \ - do \ - pushd /tmp/docker_images/${OSARCH##*:}/usr/local/interlisp >/dev/null ; \ - /usr/bin/tar -c -z \ - -f /tmp/release_tars/${RELEASE_TAG}-${OSARCH%%:*}.tgz \ - maiko/bin/osversion \ - maiko/bin/machinetype \ - maiko/bin/config.guess \ - maiko/bin/config.sub \ - maiko/${OSARCH%%:*}/lde* \ - ; \ - popd >/dev/null ; \ - done - - # Push Release to github - - name: Push the release - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: - /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.x86_64.tgz, - /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: ${{ needs.inputs.outputs.draft }} - token: ${{ secrets.GITHUB_TOKEN }} - - -###################################################################################### - - # MacOS: build for MacOS (x86_64, aarch64, universal) and use results to - # create and push release assets to github - macos: - - needs: [inputs, sentry] - if: | - needs.sentry.outputs.release_not_built == 'true' - || needs.inputs.outputs.force == 'true' - - runs-on: macos-latest - - steps: - - # Checkout the branch - - name: Checkout - uses: actions/checkout@v3 - - # Checkout the actions for this repo owner - - name: Checkout Actions - uses: actions/checkout@v3 - with: - repository: ${{ github.repository_owner }}/.github - path: ./Actions_${{ github.sha }} - - run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }} - - # Setup release tag - - name: Setup Release Tag - id: tag - uses: ./../actions/release-tag-action - - # Uninstall exisitng X11 stuff preconfigured on runner then install correct X11 dependencies - - name: Unistall X components already on the runner - run: | - brew uninstall --ignore-dependencies libxft - brew uninstall --ignore-dependencies libxrender - brew uninstall --ignore-dependencies libxext - brew uninstall --ignore-dependencies libx11 - brew uninstall --ignore-dependencies xorgproto - brew uninstall --ignore-dependencies libxdmcp - brew uninstall --ignore-dependencies libxau - - - name: Install X11 dependencies on MacOS - env: - GH_TOKEN: ${{ github.token }} - run: | - gh release download XQuartz-2.8.5 --repo XQuartz/XQuartz --pattern XQuartz-2.8.5.pkg - sudo installer -pkg ./XQuartz-2.8.5.pkg -target / - - # Install SDL dependencies - - name: Install SDL2 dependencies on MacOS - env: - GH_TOKEN: ${{ github.token }} - run: | - gh release download release-2.26.5 --repo libsdl-org/SDL --pattern SDL2-2.26.5.dmg - hdiutil attach SDL2-2.26.5.dmg - sudo ditto /Volumes/SDL2/SDL2.framework /Library/Frameworks/SDL2.framework - hdiutil detach /Volumes/SDL2/ - - # Build maiko - - name: Build ldeinit - working-directory: ./bin - run: | - export LDEARCH=x86_64-apple-darwin - ./makeright init - export LDEARCH=aarch64-apple-darwin - ./makeright init - mkdir -p ../darwin.universal - exe=ldeinit - lipo -create \ - -arch arm64 ../darwin.aarch64/${exe} \ - -arch x86_64 ../darwin.x86_64/${exe} \ - -output ../darwin.universal/${exe} - - - name: Build lde, ldex, & ldesdl - run: | - mkdir build - cd build - # -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 - cmake .. \ - -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ - -DMAIKO_DISPLAY_SDL=ON \ - -DMAIKO_DISPLAY_X11=ON \ - -DCMAKE_BUILD_TYPE=Release - cmake --build . --config Release - for exe in lde ldex ldesdl - do - lipo ${exe} -output ../darwin.x86_64/${exe} -extract x86_64 - lipo ${exe} -output ../darwin.aarch64/${exe} -extract arm64 - cp -p ${exe} ../darwin.universal/${exe} - done - - # Create release tar for github. - - name: Make release tar(s) - env: - RELEASE_TAG: ${{ steps.tag.outputs.release_tag }} - run: | - mkdir -p /tmp/release_tars - 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 - 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.aarch64.tgz, - /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-darwin.universal.tgz - tag: ${{ steps.tag.outputs.release_tag }} - draft: ${{ needs.inputs.outputs.draft }} - token: ${{ secrets.GITHUB_TOKEN }} - - - -###################################################################################### - - # Use set-sentry-action to determine set the sentry that says this release has - # been successfully built - - complete: - - runs-on: ubuntu-latest - - outputs: - build_successful: ${{ steps.output.outputs.build_successful }} - - needs: [inputs, sentry, linux, macos] - - steps: - # Checkout the actions for this repo owner - - name: Checkout Actions - uses: actions/checkout@v3 - with: - repository: ${{ github.repository_owner }}/.github - path: ./Actions_${{ github.sha }} - - run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }} - - # Set sentry - - name: Is build for this commit already completed? - id: set - uses: ./../actions/set-sentry-action - with: - tag: "release_docker" - - - name: Output - id: output - run: | - echo "build_successful=true" >> $GITHUB_OUTPUT - - -###################################################################################### diff --git a/.gitignore b/.gitignore index e5e23cf..0111213 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,12 @@ cmake-build-*/** *.armv7l-x/** *.armv7l/** *.aarch64-x/** +*.aarch64-sdl/** *.aarch64/** init.386/** *.universal/** # core files core *.core +*.swp + diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8909cf7..0000000 --- a/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -#******************************************************************************* -# -# Dockerfile to build Maiko (Stage 1) and create a Docker image and push it -# to DockerHub (stage 2). -# -# Copyright 2022 by Interlisp.org -# -# ****************************************************************************** - -# -# Build Maiko Stage -# -FROM ubuntu:focal AS builder -SHELL ["/bin/bash", "-c"] -USER root:root -# Install build tools -RUN apt-get update && apt-get install -y make clang libx11-dev gcc x11vnc xvfb -# Copy over / clean maiko repo -COPY . /app/maiko -RUN rm -rf /app/maiko/linux* -# Build maiko -WORKDIR /app/maiko/bin -RUN ./makeright x -RUN if [ "$(./osversion)" = "linux" ] && [ "$(./machinetype)" = "x86_64" ]; then ./makeright init; fi -# Prep for Install Stage -RUN mv ../$(./osversion).$(./machinetype) ../TRANSFER -# -# Install Maiko Stage -# -FROM ubuntu:focal -ARG BUILD_DATE="not_available" -ARG RELEASE_TAG="not_available" -LABEL name="Maiko" -LABEL description="Virtual machine for Interlisp Medley" -LABEL url="https://github.com/Interlisp/maiko" -LABEL build-time=$BUILD_DATE -LABEL release_tag=$RELEASE_TAG -ENV MAIKO_RELEASE=$RELEASE_TAG -ENV MAIKO_BUILD_DATE=$BUILD_DATE -ARG BUILD_LOCATION=/app/maiko -ARG INSTALL_LOCATION=/usr/local/interlisp/maiko -# -SHELL ["/bin/bash", "-c"] -USER root:root -# Copy release files into /usr/local/directories -COPY --from=builder ${BUILD_LOCATION}/bin/osversion ${INSTALL_LOCATION}/bin/ -COPY --from=builder ${BUILD_LOCATION}/bin/machinetype ${INSTALL_LOCATION}/bin/ -COPY --from=builder ${BUILD_LOCATION}/bin/config.guess ${INSTALL_LOCATION}/bin/ -COPY --from=builder ${BUILD_LOCATION}/bin/config.sub ${INSTALL_LOCATION}/bin/ -COPY --from=builder ${BUILD_LOCATION}/TRANSFER/lde* ${INSTALL_LOCATION}/TRANSFER/ -RUN cd ${INSTALL_LOCATION} && mv TRANSFER "$(cd bin && ./osversion).$(cd bin/ && ./machinetype)" -# Some niceties -USER root -WORKDIR /root -ENTRYPOINT /bin/bash From 74d6728fbaa43d5dc9e373603453a310e8289de8 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 6 Jun 2023 17:08:46 -0700 Subject: [PATCH 2/5] Results of debugging new linux workflows --- .github/workflows/Dockerfile_maiko | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index f6058fa..9267074 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -17,6 +17,8 @@ COPY . ${INSTALL_LOCATION} # Build maiko RUN cd ${INSTALL_LOCATION}/bin \ && ./makeright x cleanup\ - && ./makeright init cleanup \ - && ./makeright x \ - && ./makeright init + && ./makeright x +RUN cd ${INSTALL_LOCATION}/bin \ + && if [[ "$(./osversion)" != "linux" || "$(./mchinetype)" = "x86_64" ]]; then \ + ./makeright init; \ + fi From b6328a234d6a0c136f74036c31fc6b2dc69a2809 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 6 Jun 2023 17:55:55 -0700 Subject: [PATCH 3/5] Fix typo and cleanup trailing whitespaces in buildRelease.yml --- .github/workflows/buildRelease.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml index c4ff2dd..12bd4ed 100644 --- a/.github/workflows/buildRelease.yml +++ b/.github/workflows/buildRelease.yml @@ -18,10 +18,10 @@ # # ****************************************************************************** -name: 'Build/Push Release +name: 'Build/Push Release' # Run this workflow on ... -on: +on: workflow_dispatch: inputs: draft: @@ -97,8 +97,6 @@ jobs: echo "draft=${{ inputs.draft }}" >> $GITHUB_OUTPUT; echo "force=${{ inputs.force }}" >> $GITHUB_OUTPUT; fi - - ###################################################################################### @@ -111,7 +109,7 @@ jobs: outputs: release_not_built: ${{ steps.check.outputs.release_not_built }} - steps: + steps: # Checkout the actions for this repo owner - name: Checkout Actions uses: actions/checkout@v3 @@ -121,7 +119,7 @@ jobs: - run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }} # Check if build already run for this commit - - name: Build already completed? + - name: Build already completed? id: check continue-on-error: true uses: ./../actions/check-sentry-action @@ -134,12 +132,12 @@ jobs: # Use docker images to create and push release assets to github linux: - + needs: [inputs, sentry] if: | needs.sentry.outputs.release_not_built == 'true' || needs.inputs.outputs.force == 'true' - + runs-on: ubuntu-latest steps: @@ -151,7 +149,7 @@ jobs: path: ./Actions_${{ github.sha }} - run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }} - # Checkout the branch + # Checkout the branch - name: Checkout uses: actions/checkout@v3 @@ -171,7 +169,7 @@ jobs: echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT echo "docker_tags=${DOCKER_TAGS}" >> $GITHUB_OUTPUT - # Setup the Docker Machine Emulation environment. + # Setup the Docker Machine Emulation environment. - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: @@ -229,7 +227,7 @@ jobs: # Push Release to github - name: Push the release uses: ncipollo/release-action@v1 - with: + with: allowUpdates: true artifacts: /tmp/release_tars/${{ steps.tag.outputs.release_tag }}-linux.x86_64.tgz, @@ -255,7 +253,7 @@ jobs: steps: - # Checkout the branch + # Checkout the branch - name: Checkout uses: actions/checkout@v3 @@ -380,7 +378,7 @@ jobs: needs: [inputs, sentry, linux, macos] - steps: + steps: # Checkout the actions for this repo owner - name: Checkout Actions uses: actions/checkout@v3 @@ -390,16 +388,15 @@ jobs: - run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }} # Set sentry - - name: Is build for this commit already completed? + - name: Is build for this commit already completed? id: set uses: ./../actions/set-sentry-action with: tag: "release_docker" - + - name: Output id: output run: | echo "build_successful=true" >> $GITHUB_OUTPUT - ###################################################################################### From da7025ff028ffd831fd47fb8b5fbc3a7d7959606 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Tue, 6 Jun 2023 22:46:01 -0700 Subject: [PATCH 4/5] Update MacOS build to use cmake instead of makeright --- .github/workflows/buildRelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml index 12bd4ed..90d919d 100644 --- a/.github/workflows/buildRelease.yml +++ b/.github/workflows/buildRelease.yml @@ -298,7 +298,7 @@ jobs: sudo ditto /Volumes/SDL2/SDL2.framework /Library/Frameworks/SDL2.framework hdiutil detach /Volumes/SDL2/ - # Build maiko + # Build maiko - name: Build ldeinit working-directory: ./bin run: | From 501fb8e87a202fe9b56acbba80f44fd2e63b815f Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Thu, 8 Jun 2023 12:06:13 -0700 Subject: [PATCH 5/5] Fixing various typos --- .github/workflows/Dockerfile_builder | 2 +- .github/workflows/Dockerfile_maiko | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Dockerfile_builder b/.github/workflows/Dockerfile_builder index 9ed1df0..614c7aa 100755 --- a/.github/workflows/Dockerfile_builder +++ b/.github/workflows/Dockerfile_builder @@ -8,7 +8,7 @@ # # ****************************************************************************** -FROM ubuntu:latet +FROM ubuntu:latest SHELL ["/bin/bash", "-c"] USER root:root # Install build tools diff --git a/.github/workflows/Dockerfile_maiko b/.github/workflows/Dockerfile_maiko index 9267074..0ba13c2 100755 --- a/.github/workflows/Dockerfile_maiko +++ b/.github/workflows/Dockerfile_maiko @@ -12,13 +12,14 @@ FROM ghcr.io/interlisp/maiko-builder ARG INSTALL_LOCATION=/usr/local/interlisp/maiko +SHELL ["/bin/bash", "-c"] # Copy over / clean maiko repo COPY . ${INSTALL_LOCATION} # Build maiko RUN cd ${INSTALL_LOCATION}/bin \ - && ./makeright x cleanup\ + && ./makeright x cleanup \ && ./makeright x RUN cd ${INSTALL_LOCATION}/bin \ - && if [[ "$(./osversion)" != "linux" || "$(./mchinetype)" = "x86_64" ]]; then \ + && if [ "$(./machinetype)" = "x86_64" ]; then \ ./makeright init; \ fi