From e71e715cd347d3dc1e503695d7a747f175123e9e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 28 Oct 2020 14:19:45 -0700 Subject: build-system: Docker build for 64bit MXE We previously tried to build the MXE Docker container on GitHub using an Action, but that really didn't work well and was a lot more trouble than it was worth. So this goes back to an offline build mechanism where I simply create an updated Docker image when needed and push that to Docker Hub. But this nearly hides the most interesting change here - we are finally switching to using 64bit binaries on Windows. It's 2020 and fewer than 1% of our users use 32bit Windows machines. We'll need to expand this to be able to have both a 32bit and a 64bit version of Subsurface for Windows. But for now, this solves the problem for 99% of our users. Signed-off-by: Dirk Hohndel --- .github/workflows/mxe-dockerimage-stage1.yml | 53 ---------------------------- .github/workflows/mxe-dockerimage-stage2.yml | 40 --------------------- 2 files changed, 93 deletions(-) delete mode 100644 .github/workflows/mxe-dockerimage-stage1.yml delete mode 100644 .github/workflows/mxe-dockerimage-stage2.yml (limited to '.github') diff --git a/.github/workflows/mxe-dockerimage-stage1.yml b/.github/workflows/mxe-dockerimage-stage1.yml deleted file mode 100644 index 1d4859364..000000000 --- a/.github/workflows/mxe-dockerimage-stage1.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: MXE Docker Image CI - -on: - push: - paths: - - scripts/docker/mxe-build-container/* - - .github/workflows/mxe-docker* - -jobs: - mxe-build-container-stage1: - runs-on: ubuntu-latest - env: - # IMPORTANT: use the second digit to test new versions, each new official build should be n.0 with the first one being 1.0 - # as you test changes toward a new release, call those 1.1, 1.2, 1.3, etc - # VERSION is just that version presented as a string constant - # - VERSION: ${{ '1.0' }} - - steps: - - uses: actions/checkout@v1 - - # Because, reasons, we can't really do anything in YAML, so do this crazy shell callout thingy in order to assemble - # sane variables to use later in this job - if someone knows an easier way to do this, please let me know! - # This abomination below assembles the docker image NAME and appends ".stage1" to the VERSION - - name: set env - run: | - v=${{ env.VERSION }} - s=".stage1" - b=${{ github.ref }} # -BRANCH suffix, unless the branch is master - b=${b/refs\/heads\//} - b=${b,,} # the name needs to be all lower case - if [ $b = "master" ] ; then b="" ; else b="-$b" ; fi - echo "::set-env name=NAME::subsurface/mxe-build-container${b}:${v}${s}" - - - name: Build and Publish stage 1 Docker image to Dockerhub - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: ${{ env.NAME }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: 'Dockerfile-stage1' - workdir: './scripts/docker/mxe-build-container/' - - - name: Trigger stage 2 to run - # this triggers a dispatch event in our own repository - this allows us to work around the - # 6h runtime max (as on a two core system the total build time of this container is closer to 7h) - # we use the event_type to pass the version that we are building to the second stage - run: | - curl -XPOST -H 'authorization: token ${{ secrets.ACCESS_TOKEN }}' \ - -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Content-Type: application/json" \ - https://api.github.com/repos/subsurface-divelog/subsurface/dispatches \ - --data '{"event_type": "${{ env.VERSION }}", "client_payload": { "target_branch": "${{ github.ref }}" } }' diff --git a/.github/workflows/mxe-dockerimage-stage2.yml b/.github/workflows/mxe-dockerimage-stage2.yml deleted file mode 100644 index de286703c..000000000 --- a/.github/workflows/mxe-dockerimage-stage2.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: MXE stage 2 Docker Image CI - -# trigger this second stage via a repository dispaych event -# the version that we are building is passed in via the event type that is available to us here -# as github.event.action - -on: repository_dispatch - -jobs: - mxe-build-container-stage2: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - with: - ref: ${{ github.event.client_payload.target_branch }} - - # Grab the version from the event name that we were triggered by and add ".stage1" to find the docker image to start FROM - # And create the NAME of the final docker image (including the branch if not master) - - name: set env - run: | - v=${{ github.event.action }} - s=".stage1" - b=${{ github.event.client_payload.target_branch }} # -BRANCH suffix, unless the branch is master - b=${b/refs\/heads\//} - b=${b,,} # the name needs to be all lower case - if [ "$b" = "master" ] || [ "$b" = "" ] ; then b="" ; else b="-$b" ; fi - echo "::set-env name=VERSION::${v}${s}" - echo "::set-env name=NAME::subsurface/mxe-build-container${b}:${v}" - - - name: Build and Publish stage 2 Docker image to Dockerhub - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: ${{ env.NAME }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: 'Dockerfile-stage2' - workdir: './scripts/docker/mxe-build-container/' - buildargs: VERSION - -- cgit v1.2.3-70-g09d2