1.9.2 #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Linux | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
crystal_version: | |
required: true | |
default: "master" | |
type: string | |
previous_crystal_version: | |
required: true | |
default: "1.10.1" | |
type: string | |
env: | |
CRYSTAL_VERSION: "${{ inputs.crystal_version || 'master' }}" | |
CRYSTAL_SHA1: "${{ inputs.crystal_version || 'master' }}" | |
PREVIOUS_CRYSTAL_VERSION: "${{ inputs.previous_crystal_version || '1.9.2' }}" | |
jobs: | |
build-linux: | |
name: Build x86 Linux tarballs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: crystal-lang/distribution-scripts | |
branch: 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 | |
steps: | |
- 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://github.com/crystal-lang/crystal/releases/download/${{ env.PREVIOUS_CRYSTAL_VERSION }}/crystal-${{ env.PREVIOUS_CRYSTAL_VERSION }}-1-linux-x86_64.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 | |
# - name: Upload tarballs as artifacts | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: linux-${{ env.CRYSTAL_VERSION }} | |
# path: linux/build/*.gz | |
- name: Upload tarball for use in the next step | |
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: Upload tarball for use in the next step | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tarball | |
path: | | |
linux/build/*.tar.gz | |
!linux/build/*-bundled.tar.gz | |
package-docker: | |
name: Build the docker images | |
runs-on: ubuntu-latest | |
needs: | |
- build-x86_64 | |
- build-aarch64 | |
env: | |
tag: "crystallang/crystal:${{ inputs.crystal_version || 'master' }}" | |
steps: | |
- name: Download the linux tarballs | |
uses: actions/download-artifact@v3 | |
with: | |
name: tarball | |
path: linux/build/ | |
- run: ls linux/build/ | |
- name: Build ubuntu runtime image | |
uses: docker/build-push-action@v5 | |
with: | |
target: runtime | |
file: docker/ubuntu.Dockerfile | |
build-contexts: tarball=linux/build/ | |
push: false | |
load: true | |
tags: "${{ env.tag }}" | |
- name: Build ubuntu build image | |
uses: docker/build-push-action@v5 | |
with: | |
target: build | |
file: docker/ubuntu.Dockerfile | |
build-contexts: tarball=linux/build/ | |
push: false | |
load: true | |
tags: "${{ env.tag }}-build" | |
- name: Build alpine runtime image | |
uses: docker/build-push-action@v5 | |
with: | |
target: runtime | |
file: docker/alpine.Dockerfile | |
build-contexts: tarball=linux/build/ | |
push: false | |
load: true | |
tags: "${{ env.tag }}-alpine" | |
- name: Build alpine build image | |
uses: docker/build-push-action@v5 | |
with: | |
target: build | |
file: docker/alpine.Dockerfile | |
build-contexts: tarball=linux/build/ | |
push: false | |
load: true | |
tags: "${{ env.tag }}-alpine-build" | |
- name: Inspect ubuntu | |
run: docker image inspect "${{ env.tag }}" | |
- name: Inspect ubuntu | |
run: docker image inspect "${{ env.tag }}-build" | |
- name: Inspect alpine | |
run: docker image inspect "${{ env.tag }}-alpine" | |
- name: Inspect alpine | |
run: docker image inspect "${{ env.tag }}-alpine-build" |