diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31c202c..51913b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 7710a43..fd490b8 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -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 @@ -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 diff --git a/.github/workflows/rpm.yml b/.github/workflows/rpm.yml index 9ae2b90..a9b6dc8 100644 --- a/.github/workflows/rpm.yml +++ b/.github/workflows/rpm.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index ca235e1..7d89cd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Dockerfile b/Dockerfile index c11d7a5..4c6a665 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile.rpm b/Dockerfile.rpm index 3cf7577..907243c 100644 --- a/Dockerfile.rpm +++ b/Dockerfile.rpm @@ -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 \ diff --git a/deb.Dockerfile b/deb.Dockerfile index cdfdd5b..53ca6cc 100644 --- a/deb.Dockerfile +++ b/deb.Dockerfile @@ -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 diff --git a/set-crystal-version.sh b/set-crystal-version.sh new file mode 100755 index 0000000..2793c75 --- /dev/null +++ b/set-crystal-version.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -e + +version=$1 + +if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] +then + echo "Use: $0 " + 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 diff --git a/shard.yml b/shard.yml index 40450dd..d9f5b76 100644 --- a/shard.yml +++ b/shard.yml @@ -18,5 +18,5 @@ development_dependencies: ameba: github: crystal-ameba/ameba -crystal: 1.13.0 +crystal: 1.13.2 license: MIT diff --git a/spec/Dockerfile b/spec/Dockerfile index 2543d4a..54fa719 100644 --- a/spec/Dockerfile +++ b/spec/Dockerfile @@ -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 diff --git a/tar.Dockerfile b/tar.Dockerfile index e3f8f20..15291b8 100644 --- a/tar.Dockerfile +++ b/tar.Dockerfile @@ -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