Skip to content

Commit 4513caa

Browse files
committed
build: bump to crystal 1.18.2
1 parent d7b0195 commit 4513caa

17 files changed

Lines changed: 210 additions & 127 deletions

.github/workflows/ci.yml

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,97 @@
11
---
22
name: CI
33

4-
on:
5-
- push
6-
- pull_request
4+
permissions: {}
75

6+
on:
7+
push:
8+
branches:
9+
- '**'
10+
paths-ignore:
11+
- "**.md"
12+
pull_request:
13+
branches:
14+
- '**'
15+
paths-ignore:
16+
- "**.md"
17+
schedule:
18+
- cron: '0 4 1 * *'
19+
# Run workflow manually
20+
workflow_dispatch:
821

922
jobs:
23+
ameba:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Git checkout
27+
uses: actions/checkout@v6
28+
with:
29+
persist-credentials: false
30+
31+
- name: Setup Crystal
32+
uses: crystal-lang/install-crystal@v1
33+
with:
34+
crystal: 1.18.2
35+
36+
- name: Install dependencies
37+
run: make deps
38+
39+
- name: Run tests
40+
run: make ameba
41+
1042
test_linux:
1143
runs-on: ubuntu-latest
1244
steps:
1345
- name: Git checkout
14-
uses: actions/checkout@v4
46+
uses: actions/checkout@v6
47+
with:
48+
persist-credentials: false
1549

1650
- name: Setup Crystal
1751
uses: crystal-lang/install-crystal@v1
1852
with:
19-
crystal: 1.15.1
53+
crystal: 1.18.2
2054

2155
- name: Install dependencies
2256
run: make deps
2357

2458
- name: Run tests
2559
run: make spec
2660

27-
- name: Run static code analysis
28-
run: make ameba
29-
30-
test_macos:
31-
runs-on: macos-latest
61+
test_macos_arm64:
62+
runs-on: macos-26
3263
steps:
3364
- name: Git checkout
34-
uses: actions/checkout@v4
65+
uses: actions/checkout@v6
66+
with:
67+
persist-credentials: false
3568

3669
- name: Setup Crystal
3770
uses: crystal-lang/install-crystal@v1
3871
with:
39-
crystal: 1.15.1
72+
crystal: 1.18.2
4073

4174
- name: Install dependencies
4275
run: make deps
4376

4477
- name: Run tests
4578
run: make spec
4679

47-
- name: Run static code analysis
48-
run: make ameba
80+
test_macos_amd64:
81+
runs-on: macos-26-intel
82+
steps:
83+
- name: Git checkout
84+
uses: actions/checkout@v6
85+
with:
86+
persist-credentials: false
87+
88+
- name: Setup Crystal
89+
uses: crystal-lang/install-crystal@v1
90+
with:
91+
crystal: 1.18.2
92+
93+
- name: Install dependencies
94+
run: make deps
95+
96+
- name: Run tests
97+
run: make spec

.github/workflows/ci_nightly.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release_binaries.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Git checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v6
1515

1616
- name: Set up QEMU
1717
uses: docker/setup-qemu-action@v3
1818

19-
- name: Setup Earthly
20-
uses: earthly/actions-setup@v1
21-
with:
22-
version: v0.7.23
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
2321

2422
- name: Build static binaries
2523
run: make release-static
@@ -31,16 +29,40 @@ jobs:
3129
token: ${{ secrets.GITHUB_TOKEN }}
3230
allowUpdates: true
3331

34-
release_macos:
35-
runs-on: macos-latest
32+
release_macos_arm64:
33+
runs-on: macos-26
34+
steps:
35+
- name: Git checkout
36+
uses: actions/checkout@v6
37+
38+
- name: Setup Crystal
39+
uses: crystal-lang/install-crystal@v1
40+
with:
41+
crystal: 1.18.2
42+
43+
- name: Install dependencies
44+
run: make deps-release
45+
46+
- name: Build binary
47+
run: make release OUTPUT_FILE=squarectl-darwin-arm64
48+
49+
- name: Create release and publish assets
50+
uses: ncipollo/release-action@v1
51+
with:
52+
artifacts: "bin/*"
53+
token: ${{ secrets.GITHUB_TOKEN }}
54+
allowUpdates: true
55+
56+
release_macos_amd64:
57+
runs-on: macos-26-intel
3658
steps:
3759
- name: Git checkout
38-
uses: actions/checkout@v4
60+
uses: actions/checkout@v6
3961

4062
- name: Setup Crystal
4163
uses: crystal-lang/install-crystal@v1
4264
with:
43-
crystal: 1.15.1
65+
crystal: 1.18.2
4466

4567
- name: Install dependencies
4668
run: make deps-release

.github/workflows/release_dockerhub.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Git checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v6
15+
with:
16+
persist-credentials: false
1517

1618
- name: Docker meta
1719
id: meta
18-
uses: docker/metadata-action@v4
20+
uses: docker/metadata-action@v5
1921
with:
2022
# list of Docker images to use as base name for tags
2123
images: |
@@ -28,22 +30,22 @@ jobs:
2830
type=sha
2931
3032
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@v2
33+
uses: docker/setup-qemu-action@v3
3234

3335
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v2
36+
uses: docker/setup-buildx-action@v3
3537

3638
- name: Login to DockerHub
37-
uses: docker/login-action@v2
39+
uses: docker/login-action@v3
3840
with:
3941
username: ${{ secrets.DOCKER_USERNAME }}
4042
password: ${{ secrets.DOCKER_PASSWORD }}
4143

4244
- name: Build and push
43-
uses: docker/build-push-action@v4
45+
uses: docker/build-push-action@v6
4446
with:
4547
context: .
46-
platforms: linux/amd64
48+
platforms: linux/amd64,linux/arm64
4749
push: true
4850
tags: ${{ steps.meta.outputs.tags }}
4951
labels: ${{ steps.meta.outputs.labels }}

.tool-versions

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
crystal 1.15.1
2-
earthly 0.7.23
1+
crystal 1.18.2

Brewfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# because we heavily rely on it
4+
brew 'bash'
5+
6+
# to run some tasks
7+
brew 'make'
8+
9+
# to install other tools
10+
brew 'asdf'

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 1.6.0 (2026/05/03)
4+
5+
* build: bump to Crystal 1.18.2
6+
* build: build multi-arch / multi-plaform binaries
7+
38
## 1.5.1 (2023/07/05)
49

510
* build: bump to Crystal 1.8.2

Dockerfile

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
1+
###########
2+
# CRYSTAL #
3+
###########
4+
5+
FROM alpine:3.23 AS crystal
6+
7+
RUN apk add --update --no-cache \
8+
make \
9+
crystal=~1.18 \
10+
shards \
11+
gc-dev \
12+
gc-static \
13+
git \
14+
libxml2-dev \
15+
libxml2-static \
16+
openssl-dev \
17+
openssl-libs-static \
18+
gmp-dev \
19+
gmp-static \
20+
pcre2-dev \
21+
pcre2-static \
22+
xz-dev \
23+
xz-static \
24+
yaml-dev \
25+
yaml-static \
26+
zlib-dev \
27+
zlib-static \
28+
upx
29+
130
#########
231
# BUILD #
332
#########
433

5-
# Build squarectl with Crystal upstream image
6-
# Use alpine variant to build static binary
7-
FROM crystallang/crystal:1.15.1-alpine AS binary-file
34+
FROM crystal AS build-binary-file
835

936
# Fetch platforms variables from ARGS
1037
ARG TARGETPLATFORM
@@ -19,11 +46,9 @@ ENV \
1946
TARGETARCH=${TARGETARCH} \
2047
TARGETVARIANT=${TARGETVARIANT}
2148

22-
# Install build dependencies
23-
RUN apk add --update yaml-static
24-
2549
# Set build environment
2650
WORKDIR /build
51+
COPY .git/ /build/.git/
2752
COPY shard.yml shard.lock /build/
2853
COPY Makefile.release /build/Makefile
2954
COPY src/ /build/src/
@@ -33,13 +58,18 @@ RUN mkdir /build/bin
3358
# Build the binary
3459
RUN make release
3560

61+
# Extract binary from Docker image
62+
FROM scratch AS binary-file
63+
ARG TARGETOS
64+
ARG TARGETARCH
65+
COPY --from=build-binary-file /build/bin/squarectl-${TARGETOS}-${TARGETARCH} /
3666

3767
###########
3868
# RUNTIME #
3969
###########
4070

4171
# Build distroless images \o/
42-
FROM gcr.io/distroless/static-debian11 AS docker-image
72+
FROM gcr.io/distroless/static-debian12 AS docker-image
4373

4474
# Fetch platforms variables from ARGS
4575
ARG TARGETOS

Earthfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 Nicolas Rodriguez
3+
Copyright (c) 2021-2026 Nicolas Rodriguez
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)