Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/scripts/upload-to-packagecloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ if [ ! -f distributions.json ]; then
fi

# Get distribution ID
if [ "$PKG_TYPE" == "deb" ]; then
DIST_ID=$(jq ".deb[] | select(.index_name == \"$DIST_NAME\").versions[] | select(.index_name == \"$DIST_VERSION\").id" distributions.json)
else
DIST_ID=$(jq ".rpm[] | select(.index_name == \"$DIST_NAME\").versions[] | select(.index_name == \"$DIST_VERSION\").id" distributions.json)
fi
DIST_ID=$(jq ".${PKG_TYPE}[] | select(.index_name == \"$DIST_NAME\").versions[] | select(.index_name == \"$DIST_VERSION\").id" distributions.json)

# Find and upload packages
find pkgs -name "*.$PKG_TYPE" | xargs -I{} curl -fsSu "$PACKAGECLOUD_TOKEN:" \
-F "package[distro_version_id]=$DIST_ID" \
-F "package[package_file]=@{}" \
-XPOST https://packagecloud.io/api/v1/repos/84codes/crystal/packages.json
-XPOST https://packagecloud.io/api/v1/repos/84codes/crystal/packages.json
162 changes: 162 additions & 0 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Alpine

on:
pull_request:
push:
branches:
- main
paths-ignore:
- README.md
- .github/workflows/master.yml
schedule:
- cron: '45 4 * * *'

env:
crystal_version: 1.16.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: 18
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' }}

static-packages:
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-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 }}
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' }}
89 changes: 89 additions & 0 deletions .github/workflows/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CentOS

on:
pull_request:
push:
branches:
- main
paths-ignore:
- README.md
- .github/workflows/master.yml

env:
crystal_version: 1.16.1
shards_version: 0.19.1
gc_version: 8.2.8

permissions:
contents: read
id-token: write

jobs:
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' }}
Loading
Loading