CI #539
This file contains hidden or 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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- README.md | |
- .github/workflows/master.yml | |
schedule: | |
- cron: '45 4 * * *' | |
env: | |
crystal_version: 1.17.1 | |
shards_version: 0.19.1 | |
gc_version: 8.2.8 | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
alpine: | |
name: Alpine container | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- alpine_version: latest | |
llvm_version: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
- uses: depot/setup-action@v1 | |
- uses: depot/build-push-action@v1 | |
with: | |
project: zjh7v82xv6 | |
context: alpine | |
pull: true | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
llvm_version=${{ matrix.llvm_version }} | |
alpine_version=${{ matrix.alpine_version }} | |
tags: | | |
84codes/crystal:${{ env.crystal_version }}-alpine-${{ matrix.alpine_version }} | |
84codes/crystal:${{ env.crystal_version }}-alpine | |
84codes/crystal:latest-alpine | |
84codes/crystal:latest | |
push: ${{ github.ref == 'refs/heads/main' }} | |
pkgs: | |
name: Debian/RPM static packages | |
needs: alpine | |
runs-on: ubuntu-latest | |
if: github.event_name != 'schedule' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: depot/setup-action@v1 | |
- uses: depot/build-push-action@v1 | |
with: | |
project: zjh7v82xv6 | |
context: pkgs | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
pkg_revision=${{ github.run_number }} | |
outputs: pkgs | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crystal-static-pkgs | |
path: pkgs | |
- name: Upload deb package to Packagecloud | |
run: .github/scripts/upload-to-packagecloud.sh deb any/any | |
env: | |
PACKAGECLOUD_TOKEN: ${{ secrets.packagecloud_token }} | |
if: github.ref == 'refs/heads/main' | |
- name: Upload RPM package to Packagecloud | |
run: .github/scripts/upload-to-packagecloud.sh rpm rpm_any/rpm_any | |
env: | |
PACKAGECLOUD_TOKEN: ${{ secrets.packagecloud_token }} | |
if: github.ref == 'refs/heads/main' | |
debian: | |
name: Debian | |
runs-on: ubuntu-latest | |
if: github.event_name != 'schedule' | |
strategy: | |
max-parallel: 2 | |
fail-fast: false | |
matrix: | |
include: | |
- base_image: ubuntu | |
version: 24.04 | |
codename: noble | |
llvm_version: 18 | |
- base_image: ubuntu | |
version: 22.04 | |
codename: jammy | |
llvm_version: 15 | |
- base_image: debian | |
version: 12 | |
codename: bookworm | |
llvm_version: 19 | |
- base_image: debian | |
version: 11 | |
codename: bullseye | |
llvm_version: 16 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
- uses: depot/setup-action@v1 | |
- name: Export packages | |
uses: depot/build-push-action@v1 | |
with: | |
project: zjh7v82xv6 | |
context: debian | |
pull: true | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
base_image=${{ matrix.base_image }} | |
codename=${{ matrix.codename }} | |
llvm_version=${{ matrix.llvm_version }} | |
pkg_revision=${{ github.run_number }} | |
target: pkgs | |
outputs: pkgs | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crystal-${{ matrix.base_image }}-${{ matrix.version }}-pkgs | |
path: pkgs | |
- name: Build and push container | |
uses: depot/build-push-action@v1 | |
with: | |
project: zjh7v82xv6 | |
context: debian | |
push: ${{ github.ref == 'refs/heads/main' }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
base_image=${{ matrix.base_image }} | |
codename=${{ matrix.codename }} | |
llvm_version=${{ matrix.llvm_version }} | |
pkg_revision=${{ github.run_number }} | |
tags: | | |
84codes/crystal:${{ env.crystal_version }}-${{ matrix.base_image }}-${{ matrix.version }} | |
84codes/crystal:${{ env.crystal_version }}-${{ matrix.base_image }}-${{ matrix.codename }} | |
84codes/crystal:latest-${{ matrix.base_image }}-${{ matrix.version }} | |
84codes/crystal:latest-${{ matrix.base_image }}-${{ matrix.codename }} | |
- name: Upload to Packagecloud | |
run: .github/scripts/upload-to-packagecloud.sh deb "${{ matrix.base_image }}/${{ matrix.codename }}" | |
env: | |
PACKAGECLOUD_TOKEN: ${{ secrets.packagecloud_token }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
debian-static: | |
name: Debian (static) | |
runs-on: ubuntu-latest | |
needs: alpine | |
if: github.event_name != 'schedule' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- base_image: ubuntu | |
version: 20.04 | |
codename: focal | |
llvm_version: 12 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
- uses: depot/setup-action@v1 | |
- name: Build and push container | |
uses: depot/build-push-action@v1 | |
with: | |
project: zjh7v82xv6 | |
context: debian-static | |
pull: true | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
base_image=${{ matrix.base_image }} | |
codename=${{ matrix.codename }} | |
llvm_version=${{ matrix.llvm_version }} | |
pkg_revision=${{ github.run_number }} | |
tags: | | |
84codes/crystal:${{ env.crystal_version }}-${{ matrix.base_image }}-${{ matrix.version }} | |
84codes/crystal:latest-${{ matrix.base_image }}-${{ matrix.version }} | |
84codes/crystal:${{ env.crystal_version }}-${{ matrix.base_image }}-${{ matrix.codename }} | |
84codes/crystal:latest-${{ matrix.base_image }}-${{ matrix.codename }} | |
push: ${{ github.ref == 'refs/heads/main' }} | |
- name: Export packages | |
uses: depot/build-push-action@v1 | |
with: | |
project: zjh7v82xv6 | |
context: debian-static | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
base_image=${{ matrix.base_image }} | |
codename=${{ matrix.codename }} | |
llvm_version=${{ matrix.llvm_version }} | |
pkg_revision=${{ github.run_number }} | |
target: pkgs | |
outputs: pkgs | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crystal-${{ matrix.base_image }}-${{ matrix.version }}-pkgs | |
path: pkgs | |
- name: Upload to Packagecloud | |
run: .github/scripts/upload-to-packagecloud.sh deb "${{ matrix.base_image }}/${{ matrix.codename }}" | |
env: | |
PACKAGECLOUD_TOKEN: ${{ secrets.packagecloud_token }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
fedora: | |
name: Fedora | |
runs-on: ubuntu-latest | |
if: github.event_name != 'schedule' | |
strategy: | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
include: | |
- base_image: fedora | |
base_image_tag: 40 | |
- base_image: fedora | |
base_image_tag: 41 | |
- base_image: fedora | |
base_image_tag: 42 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
- uses: depot/setup-action@v1 | |
- uses: depot/build-push-action@v1 | |
name: Build and push container | |
with: | |
project: zjh7v82xv6 | |
context: fedora | |
pull: true | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
base_image=${{ matrix.base_image }} | |
base_image_tag=${{ matrix.base_image_tag }} | |
pkg_revision=${{ github.run_number }} | |
tags: | | |
84codes/crystal:${{ env.crystal_version }}-${{ matrix.base_image }}-${{ matrix.base_image_tag }} | |
84codes/crystal:latest-${{ matrix.base_image }}-${{ matrix.base_image_tag }} | |
push: ${{ github.ref == 'refs/heads/main' }} | |
- uses: depot/build-push-action@v1 | |
name: Export packages | |
with: | |
project: zjh7v82xv6 | |
context: fedora | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
base_image=${{ matrix.base_image }} | |
base_image_tag=${{ matrix.base_image_tag }} | |
pkg_revision=${{ github.run_number }} | |
target: pkgs | |
outputs: pkgs | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crystal-${{ matrix.base_image }}-${{ matrix.base_image_tag }}-pkgs | |
path: pkgs | |
- name: Upload to Packagecloud | |
run: .github/scripts/upload-to-packagecloud.sh rpm "${{ matrix.base_image }}/${{ matrix.base_image_tag }}" | |
env: | |
PACKAGECLOUD_TOKEN: ${{ secrets.packagecloud_token }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
centos: | |
name: CentOS Stream | |
runs-on: ubuntu-latest | |
if: github.event_name != 'schedule' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- base_image: quay.io/centos/centos | |
base_image_tag: stream9 | |
el_version: 9 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
if: ${{ github.ref == 'refs/heads/main' }} | |
- uses: depot/setup-action@v1 | |
- uses: depot/build-push-action@v1 | |
name: Build and push container | |
with: | |
project: zjh7v82xv6 | |
context: centos | |
pull: true | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
llvm_version=${{ matrix.llvm_version }} | |
base_image=${{ matrix.base_image }} | |
base_image_tag=${{ matrix.base_image_tag }} | |
pkg_revision=${{ github.run_number }} | |
tags: | | |
84codes/crystal:${{ env.crystal_version }}-centos-${{ matrix.base_image_tag }} | |
84codes/crystal:${{ env.crystal_version }}-el-${{ matrix.el_version }} | |
84codes/crystal:latest-centos-${{ matrix.base_image_tag }} | |
84codes/crystal:latest-el-${{ matrix.el_version }} | |
push: ${{ github.ref == 'refs/heads/main' }} | |
- uses: depot/build-push-action@v1 | |
name: Export packages | |
with: | |
project: zjh7v82xv6 | |
context: centos | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
crystal_version=${{ env.crystal_version }} | |
shards_version=${{ env.shards_version }} | |
gc_version=${{ env.gc_version }} | |
llvm_version=${{ matrix.llvm_version }} | |
base_image=${{ matrix.base_image }} | |
base_image_tag=${{ matrix.base_image_tag }} | |
pkg_revision=${{ github.run_number }} | |
target: pkgs | |
outputs: pkgs | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: crystal-centos-${{ matrix.base_image_tag }}-pkgs | |
path: pkgs | |
- name: Upload to Packagecloud | |
run: .github/scripts/upload-to-packagecloud.sh rpm "el/${{ matrix.el_version }}" | |
env: | |
PACKAGECLOUD_TOKEN: ${{ secrets.packagecloud_token }} | |
if: ${{ github.ref == 'refs/heads/main' }} |