Skip to content

Commit

Permalink
matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Nov 25, 2023
1 parent 73b0cb5 commit cfd8f09
Showing 1 changed file with 22 additions and 56 deletions.
78 changes: 22 additions & 56 deletions .github/workflows/maintenance-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cfd8f09

Please sign in to comment.