From cfd8f09a04d3163c9ed8aebf97867739216ba455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sat, 25 Nov 2023 20:45:57 +0100 Subject: [PATCH] matrix --- .github/workflows/maintenance-linux.yml | 78 +++++++------------------ 1 file changed, 22 insertions(+), 56 deletions(-) diff --git a/.github/workflows/maintenance-linux.yml b/.github/workflows/maintenance-linux.yml index e945599b2158..28d8b9152af5 100644 --- a/.github/workflows/maintenance-linux.yml +++ b/.github/workflows/maintenance-linux.yml @@ -21,80 +21,46 @@ env: jobs: build-linux: - name: Build x86 Linux tarballs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - repository: crystal-lang/distribution-scripts - ref: refactor/linux-makefile-build-context - - - name: Build linux binaries - working-directory: linux - run: make all #pull_images=true release=true - - build-x86_64: - name: Buildx x86 Linux tarballs - runs-on: ubuntu-latest + name: Buildx ${{ matrix.arch }} Linux tarballs + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + include: + - arch: x86_64 + runs-on: ubuntu-latest + previous_crystal_release: https://github.com/crystal-lang/crystal/releases/download/1.9.2/crystal-1.9.2-1-linux-x86_64.tar.gz + - arch: aarch64 + runs-on: [linux, ARM64] + previous_crystal_release: https://dev.alpinelinux.org/archive/crystal/crystal-1.9.2-aarch64-alpine-linux-musl.tar.gz steps: - - name: Build statically linked copiler + - name: Build statically linked compiler uses: docker/build-push-action@v5 with: context: https://github.com/crystal-lang/distribution-scripts.git#refactor/linux-makefile-build-context file: linux/Dockerfile build-args: | - previous_crystal_release=https://github.com/crystal-lang/crystal/releases/download/${{ env.PREVIOUS_CRYSTAL_VERSION }}/crystal-${{ env.PREVIOUS_CRYSTAL_VERSION }}-1-linux-x86_64.tar.gz + previous_crystal_release=https://github.com/crystal-lang/crystal/releases/download/${{ env.PREVIOUS_CRYSTAL_VERSION }}/crystal-${{ env.PREVIOUS_CRYSTAL_VERSION }}-1-linux-${{ matrix.arch }}.tar.gz crystal_version=${{ env.CRYSTAL_VERSION }} crystal_sha1=${{ env.CRYSTAL_SHA1 }} outputs: | - type=tar,path=linux/crystal-${{ env.CRYSTAL_VERSION }}-1-linux-x86_64.tar + type=tar,path=linux/crystal-${{ env.CRYSTAL_VERSION }}-1-linux-${{ matrix.arch }}.tar - # - name: Upload tarballs as artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: linux-${{ env.CRYSTAL_VERSION }} - # path: linux/build/*.gz + - name: Build tar.gz + run: gzip -c linux/crystal-${{ env.CRYSTAL_VERSION }}-1-linux-${{ matrix.arch }}.tar > linux/crystal-${{ env.CRYSTAL_VERSION }}-1-linux-${{ matrix.arch }}.tar.gz - - name: Upload tarball for use in the next step + - name: Upload tarballs as artifacts uses: actions/upload-artifact@v3 with: - name: tarball - path: | - linux/build/*.tar.gz - !linux/build/*-bundled.tar.gz - - build-aarch64: - name: Build aarch64 Linux tarballs - runs-on: [linux, ARM64] - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build statically linked copiler - uses: docker/build-push-action@v5 - with: - context: https://github.com/crystal-lang/distribution-scripts.git#refactor/linux-makefile-build-context - file: linux/Dockerfile - build-args: | - previous_crystal_release=https://dev.alpinelinux.org/archive/crystal/crystal-${{ env.PREVIOUS_CRYSTAL_VERSION }}-aarch64-alpine-linux-musl.tar.gz - crystal_version=${{ env.CRYSTAL_VERSION }} - crystal_sha1=${{ env.CRYSTAL_SHA1 }} - outputs: | - type=tar,path=linux/crystal-${{ env.CRYSTAL_VERSION }}-1-linux-aarch64.tar - - # - name: Upload tarballs as artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: linux-${{ env.CRYSTAL_VERSION }} - # path: linux/build/*.gz + name: release-${{ env.CRYSTAL_VERSION }}-${{ matrix.arch }} + path: linux/*.tar.gz - name: Upload tarball for use in the next step uses: actions/upload-artifact@v3 with: - name: tarball + name: tarball-${{ matrix.arch }} path: | - linux/build/*.tar.gz - !linux/build/*-bundled.tar.gz + linux/*.tar.gz + !linux/*-bundled.tar.gz package-docker: name: Build the docker images