Skip to content

Commit 0b345a1

Browse files
committed
Bump to Crystal 1.18.2
1 parent 8bdacfc commit 0b345a1

File tree

12 files changed

+159
-39
lines changed

12 files changed

+159
-39
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,94 @@
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.17.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

61+
test_macos_arm64:
62+
runs-on: macos-26
63+
steps:
64+
- name: Git checkout
65+
uses: actions/checkout@v6
66+
with:
67+
persist-credentials: false
68+
69+
- name: Setup Crystal
70+
uses: crystal-lang/install-crystal@v1
71+
with:
72+
crystal: 1.18.2
2773

74+
- name: Install dependencies
75+
run: make deps
2876

77+
- name: Run tests
78+
run: make spec
2979

30-
test_macos:
31-
runs-on: macos-latest
80+
test_macos_amd64:
81+
runs-on: macos-26-intel
3282
steps:
3383
- name: Git checkout
34-
uses: actions/checkout@v4
84+
uses: actions/checkout@v6
85+
with:
86+
persist-credentials: false
3587

3688
- name: Setup Crystal
3789
uses: crystal-lang/install-crystal@v1
3890
with:
39-
crystal: 1.17.1
91+
crystal: 1.18.2
4092

4193
- name: Install dependencies
4294
run: make deps

.github/workflows/release_binaries.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ 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: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
1922
- name: Build static binaries
2023
run: make release-static
2124

@@ -26,16 +29,40 @@ jobs:
2629
token: ${{ secrets.GITHUB_TOKEN }}
2730
allowUpdates: true
2831

29-
release_macos:
30-
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=stacker-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
3158
steps:
3259
- name: Git checkout
33-
uses: actions/checkout@v4
60+
uses: actions/checkout@v6
3461

3562
- name: Setup Crystal
3663
uses: crystal-lang/install-crystal@v1
3764
with:
38-
crystal: 1.17.1
65+
crystal: 1.18.2
3966

4067
- name: Install dependencies
4168
run: make deps-release

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
!/log/.keep
1313
/example/log/*
1414
!/example/log/.keep
15+
16+
# Ignore MacOS files
17+
.DS_Store

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
crystal 1.17.1
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'

Dockerfile

Lines changed: 31 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 stacker with Crystal upstream image
6-
# Use alpine variant to build static binary
7-
FROM crystallang/crystal:1.17.1-alpine AS build-binary-file
34+
FROM crystal AS build-binary-file
835

936
# Fetch platforms variables from ARGS
1037
ARG TARGETPLATFORM
@@ -19,9 +46,6 @@ 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
2751
COPY shard.yml shard.lock /build/
@@ -43,7 +67,7 @@ COPY --from=build-binary-file /build/bin/stacker-${TARGETOS}-${TARGETARCH} /
4367
###########
4468

4569
# Build distroless images \o/
46-
FROM gcr.io/distroless/static-debian11 AS docker-image
70+
FROM gcr.io/distroless/static-debian12 AS docker-image
4771

4872
# Fetch platforms variables from ARGS
4973
ARG TARGETOS

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) 2020-2023 Nicolas Rodriguez
3+
Copyright (c) 2020-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

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ SHELL := /usr/bin/env bash
99
PREFIX ?= /usr/local
1010
INSTALL_DIR = $(PREFIX)/bin
1111

12-
SOURCE_FILE = src/stacker.cr
12+
APP_NAME = stacker
13+
SOURCE_FILE = src/$(APP_NAME).cr
1314
OUTPUT_DIR = bin
14-
OUTPUT_FILE = stacker
15+
OUTPUT_FILE = $(APP_NAME)
1516

1617
SPEC_OPTS =
1718
COMPILE_OPTS_DEV = --threads 4
1819
COMPILE_OPTS_RELEASE = --threads 4 --release --error-trace
1920

2021
# Use sudo if current user is not root
22+
UID := $(shell id -u)
23+
2124
ifneq ($(UID), 0)
2225
sudo = sudo
2326
else
@@ -60,6 +63,7 @@ spec: ## Run Crystal spec
6063
doc: ## Generate Stacker documentation
6164
rm -rf docs
6265
crystal doc
66+
open docs/index.html
6367

6468
ameba: ## Run static code analysis
6569
bin/ameba
@@ -92,15 +96,15 @@ deps-release: ## Install production dependencies
9296
shards install --production
9397

9498
install: ## Install stacker in $(INSTALL_DIR)
95-
$(sudo) cp $(OUTPUT_DIR)/$(OUTPUT_FILE) $(INSTALL_DIR)/stacker
99+
$(sudo) cp $(OUTPUT_DIR)/$(OUTPUT_FILE) $(INSTALL_DIR)/$(OUTPUT_FILE)
96100

97101
uninstall: ## Uninstall stacker from $(INSTALL_DIR)
98-
$(sudo) rm -f $(INSTALL_DIR)/stacker
102+
$(sudo) rm -f $(INSTALL_DIR)/$(OUTPUT_FILE)
99103

100104
release-static: ## Build static binary with Earthly
101105
docker buildx bake binary
102-
mv packages/linux_arm64/stacker-linux-arm64 packages/
103-
mv packages/linux_amd64/stacker-linux-amd64 packages/
106+
mv packages/linux_arm64/$(OUTPUT_FILE)-linux-arm64 packages/
107+
mv packages/linux_amd64/$(OUTPUT_FILE)-linux-amd64 packages/
104108
rmdir packages/linux_arm64/ packages/linux_amd64/
105109
rm -f packages/*.sha256
106110
cd packages; for f in *; do shasum --algorithm 256 $$f > $$f.sha256; done

Makefile.release

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# Constants #
33
#############
44

5-
SOURCE_FILE = src/stacker.cr
6-
OUTPUT_FILE = bin/stacker-${TARGETOS}-${TARGETARCH}
5+
PROGRAM_NAME = stacker
6+
SOURCE_FILE = src/$(PROGRAM_NAME).cr
7+
OUTPUT_FILE = bin/$(PROGRAM_NAME)-${TARGETOS}-${TARGETARCH}
78
COMPILE_OPTS = --threads 4 --release --error-trace --static
89

910
#########

shard.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ shards:
1414

1515
crinja:
1616
git: https://github.com/straight-shoota/crinja.git
17-
version: 0.8.1+git.commit.db7eb9ea2f2d8a5601cfcea672f7670f8d01e8f1
17+
version: 0.9.0
1818

1919
crystal-env:
2020
git: https://github.com/crystal-lang/crystal-env.git
@@ -26,7 +26,7 @@ shards:
2626

2727
kemal:
2828
git: https://github.com/kemalcr/kemal.git
29-
version: 1.7.2+git.commit.e684d2ec9fac727bf63865c738d6db7529a6924c
29+
version: 1.9.0+git.commit.7a1a07f7332ec13ff1db9427b7267fe97c0e0555
3030

3131
radix:
3232
git: https://github.com/luislavena/radix.git

0 commit comments

Comments
 (0)