diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4070118..1853f1a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,8 @@ jobs: ruby-versions: uses: ruby/actions/.github/workflows/ruby_versions.yml@master with: - engine: cruby-jruby - min_version: 2.7 + engine: cruby # -jruby + min_version: 3.4 host: needs: ruby-versions @@ -23,60 +23,146 @@ jobs: matrix: os: - ubuntu-latest - - macos-14 - - windows-latest + # - macos-14 + # - windows-latest ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} - env: - - "" - include: - - { os: ubuntu-24.04-arm, ruby: 3.4 } - - { os: ubuntu-latest , ruby: 3.4, env: "JSON_DISABLE_SIMD=1" } - - { os: ubuntu-latest , ruby: 3.4, env: "JSON_DEBUG=1" } - - { os: macos-13, ruby: 3.4 } - - { os: windows-latest , ruby: mswin } # ruby/ruby windows CI - - { os: ubuntu-latest , ruby: jruby-9.4 } # Ruby 3.1 - - { os: macos-latest , ruby: truffleruby-head } - - { os: ubuntu-latest , ruby: truffleruby-head } - exclude: - - { os: windows-latest, ruby: jruby } - - { os: windows-latest, ruby: jruby-head } + # env: + # - "" + # include: + # - { os: ubuntu-24.04-arm, ruby: 3.4 } + # - { os: ubuntu-latest , ruby: 3.4, env: "JSON_DISABLE_SIMD=1" } + # - { os: ubuntu-latest , ruby: 3.4, env: "JSON_DEBUG=1" } + # - { os: macos-13, ruby: 3.4 } + # - { os: windows-latest , ruby: mswin } # ruby/ruby windows CI + # - { os: ubuntu-latest , ruby: jruby-9.4 } # Ruby 3.1 + # - { os: macos-latest , ruby: truffleruby-head } + # - { os: ubuntu-latest , ruby: truffleruby-head } + # exclude: + # - { os: windows-latest, ruby: jruby } + # - { os: windows-latest, ruby: jruby-head } + + steps: + - uses: actions/checkout@v5 + # + # - name: Set up Ruby + # uses: ruby/setup-ruby-pkgs@v1 + # with: + # bundler-cache: true + # ruby-version: ${{ matrix.ruby }} + # apt-get: "${{ startsWith(matrix.ruby, 'jruby') && 'ragel' || '' }}" + # brew: "${{ startsWith(matrix.ruby, 'jruby') && 'ragel' || '' }}" + # + # - run: bundle exec rake compile ${{ matrix.env }} + # + # - run: bundle exec rake test JSON_COMPACT=1 ${{ matrix.env }} + # + # - run: bundle exec rake build + # + # - run: gem install pkg/*.gem + # if: ${{ matrix.ruby != '3.2' }} + + valgrind: + name: Ruby memcheck + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v5 + # + # - name: Set up Ruby + # uses: ruby/setup-ruby-pkgs@v1 + # with: + # bundler-cache: true + # ruby-version: "3.3" + # apt-get: valgrind + # + # - run: bundle exec rake compile + # + # - run: bundle exec rake valgrind JSON_COMPACT=1 + + release_check: + needs: [host, valgrind] + runs-on: ubuntu-latest + outputs: + run_publish: ${{ steps.precheck.outputs.run_publish }} steps: - uses: actions/checkout@v5 - name: Set up Ruby - uses: ruby/setup-ruby-pkgs@v1 + uses: ruby/setup-ruby@v1 with: + ruby-version: "3.4" bundler-cache: true - ruby-version: ${{ matrix.ruby }} - apt-get: "${{ startsWith(matrix.ruby, 'jruby') && 'ragel' || '' }}" - brew: "${{ startsWith(matrix.ruby, 'jruby') && 'ragel' || '' }}" - - run: bundle exec rake compile ${{ matrix.env }} + - id: precheck + name: Release precheck + run: bundle exec rake ci:check_release - - run: bundle exec rake test JSON_COMPACT=1 ${{ matrix.env }} + release: + needs: release_check - - run: bundle exec rake build + # if: | + # needs.release_check.outputs.run_publish == 'true' && + # github.repository == 'ruby/json' && + # github.ref_name == github.event.repository.default_branch - - run: gem install pkg/*.gem - if: ${{ matrix.ruby != '3.2' }} + if: | + needs.release_check.outputs.run_publish == 'true' && + github.repository == 'ruby/json' - valgrind: - name: Ruby memcheck runs-on: ubuntu-latest + + environment: + name: rubygems.org + url: https://rubygems.org/gems/json + + permissions: + contents: write + id-token: write + strategy: - fail-fast: false + matrix: + ruby: ["ruby", "jruby"] steps: - - uses: actions/checkout@v5 + - name: github.repository + run: echo ${{github.repository}} + - name: github.ref_name + run: echo "${{github.ref_name}} | default_branch = ${{ github.event.repository.default_branch }}" + + - name: Harden Runner + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Ruby - uses: ruby/setup-ruby-pkgs@v1 + uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 with: + ruby-version: ${{ matrix.ruby }} bundler-cache: true - ruby-version: "3.3" - apt-get: valgrind - - run: bundle exec rake compile + # https://github.com/rubygems/rubygems/issues/5882 + - name: Install dependencies and build for JRuby + run: | + sudo apt install default-jdk maven + gem update --system + gem install ruby-maven rake-compiler --no-document + rake compile + if: matrix.ruby == 'jruby' - - run: bundle exec rake valgrind JSON_COMPACT=1 + - name: Install dependencies + run: bundle install --jobs 4 --retry 3 + + - name: Publish to RubyGems + uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1 + + - name: Create GitHub release + run: | + bundle exec rake ci:create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: matrix.ruby != 'jruby' diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml deleted file mode 100644 index cb4a260e..00000000 --- a/.github/workflows/push_gem.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Publish - -on: - workflow_run: - workflows: [CI] - types: [completed] - -permissions: - contents: read - -jobs: - check: - runs-on: ubuntu-latest - outputs: - run_publish: ${{ steps.precheck.outputs.run_publish }} - - steps: - - uses: actions/checkout@v5 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.4" - bundler-cache: true - - - id: precheck - name: Release precheck - run: bundle exec rake ci:check_release - - push: - needs: check - - if: | - needs.check.outputs.run_publish == 'true' && - github.repository == 'ruby/json' && - github.ref_name == github.event.repository.default_branch - runs-on: ubuntu-latest - - environment: - name: rubygems.org - url: https://rubygems.org/gems/json - - permissions: - contents: write - id-token: write - - strategy: - matrix: - ruby: ["ruby", "jruby"] - - steps: - - name: Harden Runner - uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 - with: - egress-policy: audit - - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Ruby - uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - # https://github.com/rubygems/rubygems/issues/5882 - - name: Install dependencies and build for JRuby - run: | - sudo apt install default-jdk maven - gem update --system - gem install ruby-maven rake-compiler --no-document - rake compile - if: matrix.ruby == 'jruby' - - - name: Install dependencies - run: bundle install --jobs 4 --retry 3 - - - name: Publish to RubyGems - uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1 - - - name: Create GitHub release - run: | - bundle exec rake ci:create_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: matrix.ruby != 'jruby' diff --git a/CHANGES.md b/CHANGES.md index 779dd3ef..e393ca84 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,10 @@ * Fix `JSON.generate` `strict: true` mode to also restrict hash keys. * Fix `JSON::Coder` to also invoke block for hash keys that aren't strings nor symbols. +### 2025-08-20 (0.0.0.debug1) + +* Testing the new release pipeline + ### 2025-07-28 (2.13.2) * Improve duplicate key warning and errors to include the key name and point to the right caller. diff --git a/lib/json/version.rb b/lib/json/version.rb index f9ac3e17..dc33da2f 100644 --- a/lib/json/version.rb +++ b/lib/json/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JSON - VERSION = '2.13.2' + VERSION = '0.0.0.debug1' end