Skip to content

Commit

Permalink
Require and use crystal 1.13.2 (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
spuun authored Aug 25, 2024
1 parent 56439b6 commit 78e4517
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
container: 84codes/crystal:latest-ubuntu-22.04
container: 84codes/crystal:1.13.2-ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: shards install
Expand All @@ -33,7 +33,7 @@ jobs:
format:
runs-on: ubuntu-latest
timeout-minutes: 10
container: 84codes/crystal:latest-ubuntu-22.04
container: 84codes/crystal:1.13.2-ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: crystal tool format --check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
tar:
runs-on: ubuntu-latest
container:
image: 84codes/crystal:latest-alpine
image: 84codes/crystal:1.13.2-alpine
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
file: deb.Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
image=84codes/crystal:latest-${{ matrix.os }}
image=84codes/crystal:1.13.2-${{ matrix.os }}
outputs: builds

- name: Upload GitHub artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
file: Dockerfile.rpm
platforms: linux/amd64,linux/arm64
build-args: |
build_image=84codes/crystal:latest-${{ matrix.os }}
build_image=84codes/crystal:1.13.2-${{ matrix.os }}
version=${{ env.version }}
outputs: RPMS

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Compile with Crystal 1.13.2, fixes a memory leak in Hash.

## [v2.0.1] - 2024-07-11

- Return unused memory faster to the OS using GC_UNMAP_THRESHOLD=1 in Dockerfile and systemd service file
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM 84codes/crystal:latest-alpine AS builder
FROM 84codes/crystal:1.13.2-alpine AS builder
WORKDIR /tmp
COPY shard.yml shard.lock ./
RUN shards install --production
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.rpm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG build_image=84codes/crystal:latest-fedora-39
ARG build_image=84codes/crystal:1.13.2-fedora-39

FROM $build_image AS builder
RUN dnf install -y --nodocs --setopt=install_weak_deps=False --repo=fedora,updates \
Expand Down
2 changes: 1 addition & 1 deletion deb.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG image=84codes/crystal:latest-debian-11
ARG image=84codes/crystal:1.13.2-debian-11
FROM $image AS builder
RUN apt-get update && \
env DEBIAN_FRONTEND=noninteractive apt-get install -y dpkg help2man lintian
Expand Down
31 changes: 31 additions & 0 deletions set-crystal-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
set -e

version=$1

if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
then
echo "Use: $0 <semver>"
exit 1
fi

files=(
Dockerfile
Dockerfile.rpm
deb.Dockerfile
tar.Dockerfile
spec/Dockerfile
.github/workflows/ci.yml
.github/workflows/packages.yml
.github/workflows/rpm.yml
)

suffix='pre-'${version}
for file in ${files[@]}
do
sed -i'.bak' 's/84codes\/crystal:[^-]*/84codes\/crystal:'${version}'/' ${file}
# sed on BSD systems require a backup extension, so we're deleting the backup afterwards
rm -f ${file}.bak
done
sed -i'.bak' 's/crystal: .*$/crystal: '${version}'/' shard.yml
rm -f shard.yml.bak
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ development_dependencies:
ameba:
github: crystal-ameba/ameba

crystal: 1.13.0
crystal: 1.13.2
license: MIT
2 changes: 1 addition & 1 deletion spec/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM 84codes/crystal:latest-ubuntu-22.04
FROM 84codes/crystal:1.13.2-ubuntu-22.04

RUN apt-get update && apt-get install -y rabbitmq-server

Expand Down
2 changes: 1 addition & 1 deletion tar.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM 84codes/crystal:latest-alpine AS builder
FROM 84codes/crystal:1.13.2-alpine AS builder
WORKDIR /usr/src/amqproxy
COPY shard.yml shard.lock ./
RUN shards install --production
Expand Down

0 comments on commit 78e4517

Please sign in to comment.