Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Nov 16, 2023
1 parent c3bcb61 commit cf78bb3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 14 deletions.
59 changes: 47 additions & 12 deletions .github/workflows/maintenance-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,23 @@ on:
type: string

env:
DOCKER_REPOSITORY: "crystallang/crystal"
CRYSTAL_VERSION: "${{ inputs.crystal_version || 'master' }}"
CRYSTAL_SHA1: "${{ inputs.crystal_version || 'master' }}"
PREVIOUS_CRYSTAL_VERSION: "${{ inputs.previous_crystal_version || '1.10.1' }}"
DOCKER_TAG: "${{ env.DOCKER_TAG }}"

jobs:
build-linux:
name: Build x86 Linux tarballs
runs-on: ubuntu-latest
steps:
- name: Checkout the distribution scripts
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Build the linux binaries
- name: Build linux binaries
working-directory: linux
run: make all pull_images=true release=true
run: make all #pull_images=true release=true

- name: Upload the binaries for use in the next step
- name: Upload tarballs for use in the next step
uses: actions/upload-artifact@v3
with:
name: linux-${{ inputs.crystal_version }}
Expand All @@ -51,15 +50,51 @@ jobs:

- run: ls linux/build/

- name: Build ubuntu
- name: Build ubuntu runtime image
uses: docker/build-push-action@v5
with:
target: runtime
file: docker/ubuntu.Dockerfile
build-contexts: |
build-artifacts=linux/build/
build-contexts: tarball=linux/build/
push: false
load: true
tag: "${{ env.DOCKER_REPOSTIROY }}:${{ inputs.CRYSTAL_VERSION }}"
tags: "${{ env.DOCKER_TAG }}"

- name: Inspect
run: docker image inspect "${{ env.DOCKER_REPOSTIROY }}:${{ inputs.CRYSTAL_VERSION }}"
- 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.DOCKER_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.DOCKER_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.DOCKER_TAG }}-alpine-build"

- name: Inspect ubuntu
run: docker image inspect "${{ env.DOCKER_TAG }}"
- name: Inspect ubuntu
run: docker image inspect "${{ env.DOCKER_TAG }}-build"
- name: Inspect alpine
run: docker image inspect "${{ env.DOCKER_TAG }}-alpine"
- name: Inspect alpine
run: docker image inspect "${{ env.DOCKER_TAG }}-alpine-build"
2 changes: 1 addition & 1 deletion docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN \
make git

ARG crystal_targz=\*.tar.gz
COPY --from=build-artifacts ${crystal_targz} /tmp/crystal.tar.gz
COPY --from=tarball ${crystal_targz} /tmp/crystal.tar.gz

RUN \
tar -xz -C /usr --strip-component=1 -f /tmp/crystal.tar.gz \
Expand Down
2 changes: 1 addition & 1 deletion docker/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ARG crystal_targz=\*.tar.gz
COPY --from=build-artifacts ${crystal_targz} /tmp/crystal.tar.gz
COPY --from=tarball ${crystal_targz} /tmp/crystal.tar.gz

RUN \
tar -xz -C /usr --strip-component=1 -f /tmp/crystal.tar.gz && \
Expand Down

0 comments on commit cf78bb3

Please sign in to comment.