Skip to content

Double docker files build #22

Double docker files build

Double docker files build #22

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 ${{ 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 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=${{ matrix.previous_crystal_release }}
crystal_version=${{ env.CRYSTAL_VERSION }}
crystal_sha1=${{ env.CRYSTAL_SHA1 }}
outputs: |
type=tar,dest=crystal-${{ env.CRYSTAL_VERSION }}-1-linux-${{ matrix.arch }}.tar
- name: Build tar.gz
run: gzip -c crystal-${{ env.CRYSTAL_VERSION }}-1-linux-${{ matrix.arch }}.tar > crystal-${{ env.CRYSTAL_VERSION }}-1-linux-${{ matrix.arch }}.tar.gz
- name: Upload tarballs as artifacts
uses: actions/upload-artifact@v3
with:
name: release-${{ env.CRYSTAL_VERSION }}-${{ matrix.arch }}
path: "*.tar.gz"
- name: Upload tarball for use in the next step
uses: actions/upload-artifact@v3
with:
name: tarball-${{ matrix.arch }}
path: |
*.tar.gz
!*-bundled.tar.gz
package-docker:
name: Build ${{ matrix.arch }} Docker images tarballs
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- arch: x86_64
runs-on: ubuntu-latest
- arch: aarch64
runs-on: [linux, ARM64]
needs:
- build-aarch64

Check failure on line 76 in .github/workflows/maintenance-linux.yml

View workflow run for this annotation

GitHub Actions / Build Linux

Invalid workflow file

The workflow is not valid. .github/workflows/maintenance-linux.yml (Line: 76, Col: 9): Job 'package-docker' depends on unknown job 'build-aarch64'. .github/workflows/maintenance-linux.yml (Line: 77, Col: 9): Job 'package-docker' depends on unknown job 'build-x86_64'.
- build-x86_64
env:
tag: "crystallang/crystal:${{ inputs.crystal_version || 'master' }}"
steps:
- name: Download the linux tarballs
uses: actions/download-artifact@v3
with:
name: tarball-${{ matrix.arch }}
- run: ls && ls *
- name: Build ubuntu runtime image
uses: docker/build-push-action@v5
with:
target: runtime
file: docker/ubuntu.Dockerfile
build-contexts: tarball=builds/
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=builds/
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=builds/
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=builds/
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"