From a810ae8b8b15d708d63d50f8a1161bc2aba0ad74 Mon Sep 17 00:00:00 2001 From: Paul Mucur Date: Sat, 28 Dec 2024 10:14:13 +0000 Subject: [PATCH] Restore support for Ruby 3.0 This reverts commit 809afab48cec044f1a25cda1468cce92329e5e53. --- .github/workflows/tests.yml | 140 ++++++++++++++++++++++++++++++------ README.md | 4 +- Rakefile | 2 +- argon2id.gemspec | 2 +- scripts/test-gem-install | 5 ++ 5 files changed, 128 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a810a28..54dec93 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -100,18 +100,36 @@ jobs: with: platform: x64-mingw-ucrt + precompile-x64-mingw32: + uses: ./.github/workflows/precompile-gem.yml + with: + platform: x64-mingw32 + + precompile-x86-mingw32: + uses: ./.github/workflows/precompile-gem.yml + with: + platform: x86-mingw32 + test-ubuntu: needs: "build-cruby-gem" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1", "truffleruby"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1", "truffleruby"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } + - { ruby: "3.1", rubygems: "default" } + - { ruby: "3.2", rubygems: "default" } + - { ruby: "3.3", rubygems: "default" } + - { ruby: "3.4.0-rc1", rubygems: "default" } + - { ruby: "truffleruby", rubygems: "default" } runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" bundler-cache: true - uses: actions/download-artifact@v4 with: @@ -126,13 +144,20 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } + - { ruby: "3.1", rubygems: "default" } + - { ruby: "3.2", rubygems: "default" } + - { ruby: "3.3", rubygems: "default" } + - { ruby: "3.4.0-rc1", rubygems: "default" } runs-on: "macos-13" steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" bundler-cache: true - uses: actions/download-artifact@v4 with: @@ -142,6 +167,25 @@ jobs: env: BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle + test-windows-2019: + needs: "build-cruby-gem" + runs-on: "windows-2019" + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.0" + rubygems: "3.5.23" + bundler-cache: true + - uses: actions/download-artifact@v4 + with: + name: cruby-gem + path: pkg + - run: ./scripts/test-gem-install + shell: bash + env: + BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle + test-windows-2022: needs: "build-cruby-gem" strategy: @@ -190,7 +234,9 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4-rc"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -204,14 +250,16 @@ jobs: docker run --rm -v "$(pwd):/argon2id" -w /argon2id \ --platform=linux/arm64 \ ruby:${{ matrix.ruby }} \ - ./scripts/test-gem-install + ./scripts/test-gem-install ${{ matrix.rubygems }} test-precompiled-aarch64-linux-musl: needs: "precompile-aarch64-linux-musl" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4-rc"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -225,14 +273,16 @@ jobs: docker run --rm -v "$(pwd):/argon2id" -w /argon2id \ --platform=linux/arm64 \ ruby:${{ matrix.ruby }}-alpine \ - ./scripts/test-gem-install + ./scripts/test-gem-install ${{ matrix.rubygems }} test-precompiled-arm-linux-gnu: needs: "precompile-arm-linux-gnu" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4-rc"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -246,14 +296,16 @@ jobs: docker run --rm -v "$(pwd):/argon2id" -w /argon2id \ --platform=linux/arm/v7 \ ruby:${{ matrix.ruby }} \ - ./scripts/test-gem-install + ./scripts/test-gem-install ${{ matrix.rubygems }} test-precompiled-arm-linux-musl: needs: "precompile-arm-linux-musl" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4-rc"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -267,14 +319,16 @@ jobs: docker run --rm -v "$(pwd):/argon2id" -w /argon2id \ --platform=linux/arm/v7 \ ruby:${{ matrix.ruby }}-alpine \ - ./scripts/test-gem-install + ./scripts/test-gem-install ${{ matrix.rubygems }} test-precompiled-x86-linux-gnu: needs: "precompile-x86-linux-gnu" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4-rc"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -288,14 +342,16 @@ jobs: docker run --rm -v "$(pwd):/argon2id" -w /argon2id \ --platform=linux/386 \ ruby:${{ matrix.ruby }} \ - ./scripts/test-gem-install + ./scripts/test-gem-install ${{ matrix.rubygems }} test-precompiled-x86-linux-musl: needs: "precompile-x86-linux-musl" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4-rc"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -309,20 +365,27 @@ jobs: docker run --rm -v "$(pwd):/argon2id" -w /argon2id \ --platform=linux/386 \ ruby:${{ matrix.ruby }}-alpine \ - ./scripts/test-gem-install + ./scripts/test-gem-install ${{ matrix.rubygems }} test-precompiled-x86_64-linux-gnu: needs: "precompile-x86_64-linux-gnu" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } + - { ruby: "3.1", rubygems: "default" } + - { ruby: "3.2", rubygems: "default" } + - { ruby: "3.3", rubygems: "default" } + - { ruby: "3.4.0-rc1", rubygems: "default" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" bundler-cache: true - uses: actions/download-artifact@v4 with: @@ -337,7 +400,9 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4-rc"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4-rc"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } runs-on: ubuntu-latest container: image: "ruby:${{ matrix.ruby }}-alpine" @@ -347,20 +412,27 @@ jobs: with: name: cruby-x86_64-linux-musl-gem path: pkg - - run: ./scripts/test-gem-install + - run: ./scripts/test-gem-install ${{ matrix.rubygems }} test-precompiled-arm64-darwin: needs: "precompile-arm64-darwin" strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } + - { ruby: "3.1", rubygems: "default" } + - { ruby: "3.2", rubygems: "default" } + - { ruby: "3.3", rubygems: "default" } + - { ruby: "3.4.0-rc1", rubygems: "default" } runs-on: macos-14 steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" bundler-cache: true - uses: actions/download-artifact@v4 with: @@ -375,13 +447,20 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3", "3.4.0-rc1"] + ruby: ["3.0", "3.1", "3.2", "3.3", "3.4.0-rc1"] + include: + - { ruby: "3.0", rubygems: "3.5.23" } + - { ruby: "3.1", rubygems: "default" } + - { ruby: "3.2", rubygems: "default" } + - { ruby: "3.3", rubygems: "default" } + - { ruby: "3.4.0-rc1", rubygems: "default" } runs-on: macos-13 steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" bundler-cache: true - uses: actions/download-artifact@v4 with: @@ -430,6 +509,25 @@ jobs: env: BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle + test-precompiled-x64-mingw32: + needs: "precompile-x64-mingw32" + runs-on: windows-2019 + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.0" + rubygems: "3.5.23" + bundler-cache: true + - uses: actions/download-artifact@v4 + with: + name: cruby-x64-mingw32-gem + path: pkg + - run: ./scripts/test-gem-install + shell: bash + env: + BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle + ruby-memcheck: runs-on: "ubuntu-latest" env: diff --git a/README.md b/README.md index 213f4d3..4460a82 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,7 @@ User.find_by(name: "alice")&.authenticate("password") #=> user This gem requires any of the following to run: -* [Ruby](https://www.ruby-lang.org/en/) 3.1 to 3.4.0-rc1 +* [Ruby](https://www.ruby-lang.org/en/) 3.0 to 3.4.0-rc1 * [JRuby](https://www.jruby.org) 9.4 * [TruffleRuby](https://www.graalvm.org/ruby/) 24.1 @@ -274,7 +274,7 @@ Where possible, a pre-compiled native gem will be provided for the following pla * `aarch64-linux`, `arm-linux`, `x86-linux`, `x86_64-linux` (requires [glibc](https://www.gnu.org/software/libc/) 2.29+, RubyGems 3.3.22+ and Bundler 2.3.21+) * [musl](https://musl.libc.org/)-based systems such as [Alpine](https://alpinelinux.org) are supported with Bundler 2.5.6+ * macOS `x86_64-darwin` and `arm64-darwin` -* Windows `x64-mingw-ucrt` +* Windows `x64-mingw32` and `x64-mingw-ucrt` * Java: any platform running JRuby 9.4 or higher ### Verifying the gems diff --git a/Rakefile b/Rakefile index 511df32..3736cb8 100644 --- a/Rakefile +++ b/Rakefile @@ -20,7 +20,7 @@ cross_platforms = %w[ x86_64-linux-musl ].freeze -ENV["RUBY_CC_VERSION"] = %w[3.4.0 3.3.5 3.2.0 3.1.0].join(":") +ENV["RUBY_CC_VERSION"] = %w[3.4.0 3.3.5 3.2.0 3.1.0 3.0.0].join(":") gemspec = Gem::Specification.load("argon2id.gemspec") diff --git a/argon2id.gemspec b/argon2id.gemspec index 10e4c7c..6c3c033 100644 --- a/argon2id.gemspec +++ b/argon2id.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |s| "source_code_uri" => "https://github.com/mudge/argon2id", "rubygems_mfa_required" => "true" } - s.required_ruby_version = ">= 3.1.0" + s.required_ruby_version = ">= 3.0.0" s.extensions = ["ext/argon2id/extconf.rb"] s.files = [ "CHANGELOG.md", diff --git a/scripts/test-gem-install b/scripts/test-gem-install index fe3f5c0..ee12390 100755 --- a/scripts/test-gem-install +++ b/scripts/test-gem-install @@ -2,6 +2,11 @@ set -eu +if [ -n "$1" ] +then + gem update --system "$1" +fi + gem install --no-document pkg/*.gem cd "$(dirname "$(gem which argon2id)")/.." bundle