From 3492ceda43e52dac8566dd2b16521356ebfccf05 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:38:01 +0200 Subject: [PATCH 1/9] Try autmated releasing --- CHANGES.md | 4 ++++ lib/json/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 779dd3ef7..e393ca846 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 f9ac3e17a..dc33da2fa 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 From 59f783bad51049042bc3024f757fc8a8fa114388 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:39:03 +0200 Subject: [PATCH 2/9] WIP --- .github/workflows/push_gem.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml index cb4a260e5..c33c36b3a 100644 --- a/.github/workflows/push_gem.yml +++ b/.github/workflows/push_gem.yml @@ -33,7 +33,8 @@ jobs: if: | needs.check.outputs.run_publish == 'true' && github.repository == 'ruby/json' && - github.ref_name == github.event.repository.default_branch + github.ref_name == 'try-auto-release' + # github.event.repository.default_branch runs-on: ubuntu-latest environment: From 75dc256dc831536998c65ad5505f98d2b78f0b77 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:46:35 +0200 Subject: [PATCH 3/9] WIP --- .github/workflows/ci.yml | 77 ++++++++++++++++++++++++++++++ .github/workflows/push_gem.yml | 86 ---------------------------------- 2 files changed, 77 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/push_gem.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4070118b..14afe6fbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,3 +80,80 @@ jobs: - 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@v1 + with: + ruby-version: "3.4" + bundler-cache: true + + - id: precheck + name: Release precheck + run: bundle exec rake ci:check_release + + release: + needs: release_check + + if: | + needs.release_check.outputs.run_publish == 'true' && + github.repository == 'ruby/json' && + github.ref_name == 'try-auto-release' + # 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/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml deleted file mode 100644 index c33c36b3a..000000000 --- a/.github/workflows/push_gem.yml +++ /dev/null @@ -1,86 +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 == 'try-auto-release' - # 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' From 378d0d51c28356d95e4663ea7a2317894a1b7264 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:50:50 +0200 Subject: [PATCH 4/9] Skip CI --- .github/workflows/ci.yml | 92 ++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14afe6fbe..3a918d6d3 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,43 +23,43 @@ 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' }} + # + # - 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 @@ -69,17 +69,17 @@ jobs: 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 + # + # - 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] From eeab53b7d6d9f4a37afe2036f469067f2a1c8f91 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:51:30 +0200 Subject: [PATCH 5/9] WIP --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a918d6d3..b26c6bcd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,9 +104,9 @@ jobs: needs: release_check if: | - needs.release_check.outputs.run_publish == 'true' && - github.repository == 'ruby/json' && - github.ref_name == 'try-auto-release' + needs.release_check.outputs.run_publish == 'true' # && + # github.repository == 'ruby/json' && + # github.ref_name == 'try-auto-release' # github.event.repository.default_branch runs-on: ubuntu-latest From adc8dafe0604e0783290539853434e3ca2e984ef Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:52:32 +0200 Subject: [PATCH 6/9] WIP --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b26c6bcd8..1831d68f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,6 +123,10 @@ jobs: ruby: ["ruby", "jruby"] steps: + - name: github.repository + run: echo ${{github.repository}} + - name: github.ref_name + run: echo ${{github.ref_name}} - name: Harden Runner uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 with: From fa482e54101a3fdb6ac6cb8b183aff50b61e573f Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:53:42 +0200 Subject: [PATCH 7/9] WIP --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1831d68f3..b559e840f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,9 @@ jobs: needs: release_check if: | - needs.release_check.outputs.run_publish == 'true' # && + needs.release_check.outputs.run_publish == 'true' + + # && # github.repository == 'ruby/json' && # github.ref_name == 'try-auto-release' # github.event.repository.default_branch From b31e096caaa7a52ece917008d968e4dd8433a265 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:54:57 +0200 Subject: [PATCH 8/9] WIP --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b559e840f..85dae3703 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,13 +103,14 @@ jobs: release: needs: release_check + # if: | + # needs.release_check.outputs.run_publish == 'true' && + # github.repository == 'ruby/json' && + # github.ref_name == github.event.repository.default_branch + if: | needs.release_check.outputs.run_publish == 'true' - - # && - # github.repository == 'ruby/json' && - # github.ref_name == 'try-auto-release' - # github.event.repository.default_branch + runs-on: ubuntu-latest environment: @@ -128,7 +129,8 @@ jobs: - name: github.repository run: echo ${{github.repository}} - name: github.ref_name - run: echo ${{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: From 1ceed8e1a6155ce755726e3c5baf8a38a149436b Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 29 Aug 2025 13:59:11 +0200 Subject: [PATCH 9/9] WIP --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85dae3703..1853f1a2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,8 @@ jobs: # github.ref_name == github.event.repository.default_branch if: | - needs.release_check.outputs.run_publish == 'true' + needs.release_check.outputs.run_publish == 'true' && + github.repository == 'ruby/json' runs-on: ubuntu-latest