From d0558971216037b9063ae1e330bcc25f139bfe6c Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 10 Jun 2021 19:00:59 +0200 Subject: [PATCH 01/46] Fix logic to select the latest JRuby version * The maven 'latest' field is unusuable, the order is unpredictable and we need to skip old 9000.dev-SNAPSHOT snapshots. See https://github.com/jruby/jruby/issues/6713 --- find-jruby-head-url-nokogiri.rb | 5 ++++- find-jruby-head-url.rb | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/find-jruby-head-url-nokogiri.rb b/find-jruby-head-url-nokogiri.rb index e3f147a..dfd0710 100644 --- a/find-jruby-head-url-nokogiri.rb +++ b/find-jruby-head-url-nokogiri.rb @@ -1,4 +1,5 @@ require 'open-uri' +require 'rubygems' require 'nokogiri' base_url = 'https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-dist' @@ -9,7 +10,9 @@ STDERR.puts xml versions = Nokogiri::XML(xml).css('version').map(&:text) -most_recent = (versions - %w[9000.dev-SNAPSHOT]).last + +versions.delete('9000.dev-SNAPSHOT') +most_recent = versions.max_by { |v| Gem::Version.new(v) } builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" STDERR.puts builds_url diff --git a/find-jruby-head-url.rb b/find-jruby-head-url.rb index 1546759..69c3ab1 100644 --- a/find-jruby-head-url.rb +++ b/find-jruby-head-url.rb @@ -1,4 +1,5 @@ require 'open-uri' +require 'rubygems' module MicroXMLParser HEADER = %r{<\?xml\s.+\?>\n} @@ -65,7 +66,9 @@ def self.rec(xml) parsed = MicroXMLParser.parse(xml) versions = parsed.dig(:metadata, :versioning, :versions).map { |e| e[:version] } -most_recent = (versions - %w[9000.dev-SNAPSHOT]).last + +versions.delete('9000.dev-SNAPSHOT') +most_recent = versions.max_by { |v| Gem::Version.new(v) } builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" STDERR.puts builds_url From e71632282d051af6cfcb18e9073cb4a5a63e50a0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 10 Jun 2021 19:07:02 +0200 Subject: [PATCH 02/46] jruby-head includes bundler * And if it does not, failing the build would be good to notice it. --- .github/workflows/build.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e910cfb..f272113 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,15 +106,6 @@ jobs: - name: Create archive run: tar czf jruby-head-${{ matrix.os }}.tar.gz jruby-head - - name: Install Bundler if needed - shell: bash - run: | - if [ ! -e jruby-head/bin/bundle ]; then - export PATH="$PWD/jruby-head/bin:$PATH" - gem env - gem install bundler -v '~> 1' --no-document - fi - # Test - run: echo "$PWD/jruby-head/bin" >> $GITHUB_PATH - run: ruby --version From 4ece8fe59e66e8a3b0b8bb307ade78e7a2534e42 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 25 Sep 2021 13:50:44 +0200 Subject: [PATCH 03/46] Ubuntu 16.04 is no longer supported on GitHub Actions --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f272113..29bd08b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest ] + os: [ ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: - uses: actions/download-artifact@v1 From eee7cf37e768e67fb199516769d10301dab603a0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 26 Sep 2021 13:38:36 +0200 Subject: [PATCH 04/46] Use specific OS versions and not -latest so the meaning does not change * We want to build on the oldest version, but the filename should still be macos-latest/windows-latest for compatibility. --- .github/workflows/build.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29bd08b..5dab364 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest ] + os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019 ] runs-on: ${{ matrix.os }} steps: - uses: actions/download-artifact@v1 @@ -62,6 +62,14 @@ jobs: run: | upload_url=$(cat info/upload_url) echo "::set-output name=upload_url::$upload_url" + - name: Set platform + id: platform + shell: bash + run: | + platform=${{ matrix.os }} + platform=${platform/macos-*/macos-latest} + platform=${platform/windows-*/windows-latest} + echo "::set-output name=platform::$platform" # Build - uses: actions/checkout@v2 @@ -104,7 +112,7 @@ jobs: # Create ruby.bat, so 'ruby' works in pwsh echo -en "@ECHO OFF\r\n@\"%~dp0jruby.exe\" %*\r\n" > ruby.bat - name: Create archive - run: tar czf jruby-head-${{ matrix.os }}.tar.gz jruby-head + run: tar czf jruby-head-${{ steps.platform.outputs.platform }}.tar.gz jruby-head # Test - run: echo "$PWD/jruby-head/bin" >> $GITHUB_PATH @@ -123,8 +131,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.upload_info.outputs.upload_url }} - asset_path: jruby-head-${{ matrix.os }}.tar.gz - asset_name: jruby-head-${{ matrix.os }}.tar.gz + asset_path: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz + asset_name: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz asset_content_type: application/gzip metadata: From 6664ce8cf240cffb6e025a2419d21772952a668e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 7 Nov 2021 15:59:12 +0100 Subject: [PATCH 05/46] Update open-uri test to work on Ruby 3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5dab364..79b4757 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,7 +119,7 @@ jobs: - run: ruby --version - run: gem --version - run: rake --version - - run: ruby -ropen-uri -e 'puts open(%{https://rubygems.org/}) { |f| f.read(1024) }' + - run: ruby -ropen-uri -e 'puts URI.send(:open, %{https://rubygems.org/}) { |f| f.read(1024) }' - run: gem install json:2.2.0 --no-document - run: bundle --version - run: bundle install From 66251172b27b5a05906e5301cc0af486d88655b0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 7 Nov 2021 16:01:22 +0100 Subject: [PATCH 06/46] Check jruby is in PATH --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79b4757..df1c04d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,12 +111,14 @@ jobs: cp jruby ruby # Create ruby.bat, so 'ruby' works in pwsh echo -en "@ECHO OFF\r\n@\"%~dp0jruby.exe\" %*\r\n" > ruby.bat + ls -l - name: Create archive run: tar czf jruby-head-${{ steps.platform.outputs.platform }}.tar.gz jruby-head # Test - run: echo "$PWD/jruby-head/bin" >> $GITHUB_PATH - run: ruby --version + - run: ruby -e 'raise unless RUBY_ENGINE == %{jruby}' - run: gem --version - run: rake --version - run: ruby -ropen-uri -e 'puts URI.send(:open, %{https://rubygems.org/}) { |f| f.read(1024) }' From 081ae69ca1b89439bbbc4de57973162a3c6190d0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 7 Nov 2021 16:46:32 +0100 Subject: [PATCH 07/46] Fix setting the Path on Windows --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df1c04d..67e2786 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,6 +117,15 @@ jobs: # Test - run: echo "$PWD/jruby-head/bin" >> $GITHUB_PATH + if: "!startsWith(matrix.os, 'windows')" + - run: echo "$($pwd.Path)\jruby-head\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append + if: startsWith(matrix.os, 'windows') + - run: which ruby + if: "!startsWith(matrix.os, 'windows')" + - run: where.exe ruby + if: startsWith(matrix.os, 'windows') + - run: echo $Env:Path + - run: ruby --version - run: ruby -e 'raise unless RUBY_ENGINE == %{jruby}' - run: gem --version From 32ccf7c6000718909636b57543dc90b4403600a5 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 19 Dec 2021 13:07:48 +0100 Subject: [PATCH 08/46] Use a version-like tag name for correct release ordering --- .github/workflows/build.yml | 2 +- trigger.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67e2786..6b60848 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: shell: bash run: | if [[ "${{ github.event_name }}" == "schedule" ]]; then - tag=builds-$(date +%Y%m%d-%H%M%S) + tag=v$(date +%Y%m%d.%H%M%S) else tag=$(basename "${{ github.ref }}") fi diff --git a/trigger.sh b/trigger.sh index e90e757..fd13c27 100755 --- a/trigger.sh +++ b/trigger.sh @@ -1,4 +1,4 @@ #!/bin/sh -tag=builds-$(date +%Y%m%d-%H%M%S) +tag=v$(date +%Y%m%d.%H%M%S) git tag "$tag" git push origin "$tag" From e06ddadb584e6c7ec1c2905fff447459d79fd4bc Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 19 Dec 2021 14:16:28 +0100 Subject: [PATCH 09/46] Automatically remove tags without a release --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b60848..c70c3fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -170,3 +170,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: n: 3 + remove_tags_without_release: true From dfa533dba4b0387ea0a23130df077e1ed6f9d43e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 26 Jun 2022 13:42:15 +0200 Subject: [PATCH 10/46] Refactor to use job outputs --- .github/workflows/build.yml | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c70c3fe..03b2e76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,9 @@ jobs: release: name: Create GitHub Release runs-on: ubuntu-latest + outputs: + release_id: ${{ steps.create_release.outputs.id }} + upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - uses: actions/checkout@v2 with: @@ -34,16 +37,6 @@ jobs: release_name: ${{ steps.create_tag.outputs.tag }} draft: true prerelease: false - - name: Create artifact files - shell: bash - run: | - mkdir info - echo "${{ steps.create_release.outputs.id }}" > info/release_id - echo "${{ steps.create_release.outputs.upload_url }}" > info/upload_url - - uses: actions/upload-artifact@v1 - with: - name: info - path: info build: needs: [release] @@ -53,15 +46,6 @@ jobs: os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019 ] runs-on: ${{ matrix.os }} steps: - - uses: actions/download-artifact@v1 - with: - name: info - - name: Set upload_url - id: upload_info - shell: bash - run: | - upload_url=$(cat info/upload_url) - echo "::set-output name=upload_url::$upload_url" - name: Set platform id: platform shell: bash @@ -141,30 +125,21 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.upload_info.outputs.upload_url }} + upload_url: ${{ needs.release.outputs.upload_url }} asset_path: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz asset_name: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz asset_content_type: application/gzip metadata: name: Publish Release - needs: [build] + needs: [release, build] runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v1 - with: - name: info - - name: Set publish_info - id: publish_info - shell: bash - run: | - release_id=$(cat info/release_id) - echo "::set-output name=release_id::$release_id" - uses: eregon/publish-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - release_id: ${{ steps.publish_info.outputs.release_id }} + release_id: ${{ needs.release.outputs.release_id }} - uses: eregon/keep-last-n-releases@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 133bd5479ae83b746fe4f8e9a682a91b83aac6f0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 26 Jun 2022 13:53:00 +0200 Subject: [PATCH 11/46] Workaround for https://github.com/jruby/jruby/issues/7182 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03b2e76..a78fbfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,6 +45,8 @@ jobs: matrix: os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019 ] runs-on: ${{ matrix.os }} + env: # https://github.com/jruby/jruby/issues/7182 + JAVA_OPTS: -Djdk.io.File.enableADS=true steps: - name: Set platform id: platform From cfc11a81895fb50ceebbbdab69d8aabefbc6448b Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 6 Aug 2022 16:47:12 +0200 Subject: [PATCH 12/46] Build on ubuntu-22.04 as well --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a78fbfa..5c2e7dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019 ] + os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-10.15, windows-2019 ] runs-on: ${{ matrix.os }} env: # https://github.com/jruby/jruby/issues/7182 JAVA_OPTS: -Djdk.io.File.enableADS=true From 5312ae5e87e0a670e6f5a960f5824742f6d290ae Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Sat, 21 Jan 2023 13:42:19 +0900 Subject: [PATCH 13/46] Migrate `set-output` to `$GITHUB_OUTPUT` https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c2e7dd..76bf436 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: else tag=$(basename "${{ github.ref }}") fi - echo "::set-output name=tag::$tag" + echo "tag=$tag" >> $GITHUB_OUTPUT - name: Create Release id: create_release uses: actions/create-release@v1 @@ -55,7 +55,7 @@ jobs: platform=${{ matrix.os }} platform=${platform/macos-*/macos-latest} platform=${platform/windows-*/windows-latest} - echo "::set-output name=platform::$platform" + echo "platform=$platform" >> $GITHUB_OUTPUT # Build - uses: actions/checkout@v2 From ba2a129fda62ceed14590836711f92073538c716 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 22 Feb 2023 14:53:45 +0900 Subject: [PATCH 14/46] Removed macos-10.15 because it will be removed at 2023-03-31 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76bf436..42eb726 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-10.15, windows-2019 ] + os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-11, windows-2019 ] runs-on: ${{ matrix.os }} env: # https://github.com/jruby/jruby/issues/7182 JAVA_OPTS: -Djdk.io.File.enableADS=true From 6d82e9b9f61da5f642ab6b84ab5f2ad95cd02089 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 23 Feb 2023 07:23:02 +0900 Subject: [PATCH 15/46] Also removed deprecated ubuntu-18.04 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42eb726..3d480e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-11, windows-2019 ] + os: [ ubuntu-20.04, ubuntu-22.04, macos-11, windows-2019 ] runs-on: ${{ matrix.os }} env: # https://github.com/jruby/jruby/issues/7182 JAVA_OPTS: -Djdk.io.File.enableADS=true From bc12972cc77856fe4b712b4fc77a7ab8490f5b89 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 30 Sep 2023 12:22:03 +0200 Subject: [PATCH 16/46] Use the same workflow as truffleruby-dev-builder --- .github/workflows/build.yml | 95 ++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d480e6..bcae577 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,52 +1,86 @@ name: JRuby Dev Builds on: + workflow_dispatch: push: tags: - '*' schedule: - cron: '0 19 * * *' jobs: + prepare: + name: Check if the latest jruby commit is already built + runs-on: ubuntu-latest + outputs: + should_build: ${{ steps.check_commit.outputs.result }} + commit: ${{ steps.latest_commit.outputs.commit }} + steps: + - name: Clone jruby + uses: actions/checkout@v3 + with: + repository: jruby/jruby + path: jruby + - name: Set latest_commit + id: latest_commit + working-directory: jruby + run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Check if latest commit already built + uses: actions/github-script@v6 + id: check_commit + with: + script: | + const latestDevCommit = "${{ steps.latest_commit.outputs.commit }}" + const { owner, repo } = context.repo + let { data: release } = await github.rest.repos.getLatestRelease({ owner, repo }) + const latestReleaseCommit = release.body.split('@')[1] + console.log(`Latest release commit: ${latestReleaseCommit}`) + console.log(`Latest jruby commit: ${latestDevCommit}`) + if (latestReleaseCommit === latestDevCommit) { + return 'false' + } else { + return 'true' + } + result-encoding: string + release: name: Create GitHub Release + needs: [prepare] + # We don't build JRuby from the repo commit but from latest maven snapshort, so always run + # if: needs.prepare.outputs.should_build == 'true' runs-on: ubuntu-latest outputs: - release_id: ${{ steps.create_release.outputs.id }} - upload_url: ${{ steps.create_release.outputs.upload_url }} + tag: ${{ steps.tag.outputs.tag }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - if: github.event_name == 'schedule' - - name: Create tag - id: create_tag - shell: bash + if: github.event_name != 'push' + + - name: Set tag name + id: tag run: | - if [[ "${{ github.event_name }}" == "schedule" ]]; then + if [[ "${{ github.event_name }}" != "push" ]]; then tag=v$(date +%Y%m%d.%H%M%S) else tag=$(basename "${{ github.ref }}") fi echo "tag=$tag" >> $GITHUB_OUTPUT - name: Create Release - id: create_release - uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.create_tag.outputs.tag }} - release_name: ${{ steps.create_tag.outputs.tag }} - draft: true - prerelease: false + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + tag="${{ steps.tag.outputs.tag }}" + body="jruby/jruby@${{ needs.prepare.outputs.commit }}" + gh release create --draft "$tag" --title "$tag" --notes "$body" build: - needs: [release] + needs: [prepare, release] strategy: fail-fast: false matrix: os: [ ubuntu-20.04, ubuntu-22.04, macos-11, windows-2019 ] runs-on: ${{ matrix.os }} - env: # https://github.com/jruby/jruby/issues/7182 - JAVA_OPTS: -Djdk.io.File.enableADS=true steps: - name: Set platform id: platform @@ -58,7 +92,8 @@ jobs: echo "platform=$platform" >> $GITHUB_OUTPUT # Build - - uses: actions/checkout@v2 + - name: Clone this repo to get find-jruby-head-url.rb + uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 @@ -123,25 +158,21 @@ jobs: - run: bundle exec rake --version - name: Upload Built Ruby - uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.release.outputs.upload_url }} - asset_path: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz - asset_name: jruby-head-${{ steps.platform.outputs.platform }}.tar.gz - asset_content_type: application/gzip + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: gh release upload "${{ needs.release.outputs.tag }}" "jruby-head-${{ steps.platform.outputs.platform }}.tar.gz" - metadata: + publish: name: Publish Release needs: [release, build] runs-on: ubuntu-latest steps: - - uses: eregon/publish-release@v1 + - name: Publish Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - release_id: ${{ needs.release.outputs.release_id }} + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: gh release edit "${{ needs.release.outputs.tag }}" --draft=false - uses: eregon/keep-last-n-releases@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7124b9c7004f32df1020f13dbf11e66742867fd7 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 21 Oct 2023 12:50:37 +0200 Subject: [PATCH 17/46] Build on macos-arm64 --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcae577..85d63e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, macos-11, windows-2019 ] + os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-arm-oss, windows-2019 ] runs-on: ${{ matrix.os }} steps: - name: Set platform @@ -87,7 +87,8 @@ jobs: shell: bash run: | platform=${{ matrix.os }} - platform=${platform/macos-*/macos-latest} + platform=${platform/macos-11/macos-latest} + platform=${platform/macos-arm-oss/macos-13-arm64} platform=${platform/windows-*/windows-latest} echo "platform=$platform" >> $GITHUB_OUTPUT From f13d505dcccffd4c8f74dc97b62d7a01be9984c6 Mon Sep 17 00:00:00 2001 From: m-nakamura145 Date: Wed, 17 Jan 2024 21:53:33 +0900 Subject: [PATCH 18/46] Update latest checkout action version --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85d63e8..cfd6c0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: commit: ${{ steps.latest_commit.outputs.commit }} steps: - name: Clone jruby - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: jruby/jruby path: jruby @@ -51,7 +51,7 @@ jobs: outputs: tag: ${{ steps.tag.outputs.tag }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 if: github.event_name != 'push' @@ -94,7 +94,7 @@ jobs: # Build - name: Clone this repo to get find-jruby-head-url.rb - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 From 12f41e6acccfff88d1d402878aec1455ca54e5ad Mon Sep 17 00:00:00 2001 From: m-nakamura145 Date: Wed, 17 Jan 2024 22:49:05 +0900 Subject: [PATCH 19/46] Added dependabot for GitHub Actions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b18fd29 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'weekly' From 555cc647357baab41739d463e149d6348d7c97a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:18:57 +0000 Subject: [PATCH 20/46] Bump actions/github-script from 6 to 7 Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfd6c0c..d5584e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - name: Check if latest commit already built - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: check_commit with: script: | From e8a73448c192cd65a2c9e139998a1e3ca267ae2f Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 19 May 2024 23:57:07 +0900 Subject: [PATCH 21/46] ubuntu-24.04 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5584e9..cfa9b62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-arm-oss, windows-2019 ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-11, macos-arm-oss, windows-2019 ] runs-on: ${{ matrix.os }} steps: - name: Set platform From 3f81293cf7a47523e971db536531359372fd5866 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 20 May 2024 18:49:26 +0900 Subject: [PATCH 22/46] Use setup-ruby@master to partially fix the cycle for new runner images * So this workflow works on ubuntu-24.04 without needing a release. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfa9b62..155a3f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: # Build - name: Clone this repo to get find-jruby-head-url.rb uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@master with: ruby-version: 2.6 - name: Download latest jruby nightly archive From ee730cab131c3c7e618a5f6237b5f692e4ff8237 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 30 Jun 2024 12:43:16 +0200 Subject: [PATCH 23/46] Switch to macOS 12 since macos-11 is no longer available --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 155a3f5..917b352 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-11, macos-arm-oss, windows-2019 ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-arm-oss, windows-2019 ] runs-on: ${{ matrix.os }} steps: - name: Set platform @@ -87,7 +87,7 @@ jobs: shell: bash run: | platform=${{ matrix.os }} - platform=${platform/macos-11/macos-latest} + platform=${platform/macos-12/macos-latest} platform=${platform/macos-arm-oss/macos-13-arm64} platform=${platform/windows-*/windows-latest} echo "platform=$platform" >> $GITHUB_OUTPUT From 39b55e3fc38e5410238a1360884009c6b108ccd8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 5 Jul 2024 14:00:33 +0900 Subject: [PATCH 24/46] Removed macos-arm-oss from GitHub Actions --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 917b352..8274909 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-arm-oss, windows-2019 ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-14, windows-2019 ] runs-on: ${{ matrix.os }} steps: - name: Set platform @@ -88,7 +88,7 @@ jobs: run: | platform=${{ matrix.os }} platform=${platform/macos-12/macos-latest} - platform=${platform/macos-arm-oss/macos-13-arm64} + platform=${platform/macos-14/macos-13-arm64} platform=${platform/windows-*/windows-latest} echo "platform=$platform" >> $GITHUB_OUTPUT From 28a9c2dbfaaac2e4bded2323b46e61b0a9a4f6a7 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 6 Dec 2024 22:24:02 +0100 Subject: [PATCH 25/46] No more macos-12 runners, minimum for macos-amd64 is now macos-13 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8274909..40b7a86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-14, windows-2019 ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, windows-2019 ] runs-on: ${{ matrix.os }} steps: - name: Set platform @@ -87,7 +87,7 @@ jobs: shell: bash run: | platform=${{ matrix.os }} - platform=${platform/macos-12/macos-latest} + platform=${platform/macos-13/macos-latest} platform=${platform/macos-14/macos-13-arm64} platform=${platform/windows-*/windows-latest} echo "platform=$platform" >> $GITHUB_OUTPUT From 5e85d88f7162fcb9149aa57e0d0e10a55e2fbbb9 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 10 Dec 2024 18:41:39 -0600 Subject: [PATCH 26/46] Index into array resulting from Hash#map Not sure why this is suddenly failing but the elements passed to this `map` block are not hashes, they are arrays. This is the simplest fix. --- find-jruby-head-url.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-jruby-head-url.rb b/find-jruby-head-url.rb index 69c3ab1..bcfc3bf 100644 --- a/find-jruby-head-url.rb +++ b/find-jruby-head-url.rb @@ -65,7 +65,7 @@ def self.rec(xml) STDERR.puts xml parsed = MicroXMLParser.parse(xml) -versions = parsed.dig(:metadata, :versioning, :versions).map { |e| e[:version] } +versions = parsed.dig(:metadata, :versioning, :versions).map { |e| e[1] } versions.delete('9000.dev-SNAPSHOT') most_recent = versions.max_by { |v| Gem::Version.new(v) } From c018acd4c04033d739eb948180eb1ffca0a924d4 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 14 Dec 2024 22:07:05 +0100 Subject: [PATCH 27/46] Use find-jruby-head-url-nokogiri.rb * Installing nokogiri used to be slow, but no longer a problem nowadays. * It's more correct, see https://github.com/ruby/jruby-dev-builder/pull/7 --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40b7a86..bc6fcba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,15 +93,16 @@ jobs: echo "platform=$platform" >> $GITHUB_OUTPUT # Build - - name: Clone this repo to get find-jruby-head-url.rb + - name: Clone this repo to get find-jruby-head-url-nokogiri.rb uses: actions/checkout@v4 - uses: ruby/setup-ruby@master with: - ruby-version: 2.6 + ruby-version: ruby - name: Download latest jruby nightly archive shell: bash run: | - url=$(ruby find-jruby-head-url.rb) + gem install nokogiri + url=$(ruby find-jruby-head-url-nokogiri.rb) echo "$url" curl --fail -L -o jruby-head.tar.gz "$url" - uses: eregon/clean-path@v1 From c5cf8fafc93d8b0596fa411bdf7f22d2ecd82e4e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 18 Jan 2025 23:30:53 +0100 Subject: [PATCH 28/46] Build on linux-arm64 as well --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc6fcba..f3effea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, windows-2019 ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019 ] runs-on: ${{ matrix.os }} steps: - name: Set platform @@ -89,6 +89,7 @@ jobs: platform=${{ matrix.os }} platform=${platform/macos-13/macos-latest} platform=${platform/macos-14/macos-13-arm64} + platform=${platform/%-arm/-arm64} platform=${platform/windows-*/windows-latest} echo "platform=$platform" >> $GITHUB_OUTPUT From f7f54e3ef29ba442837d823c1bf39ed94633f7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Mon, 24 Feb 2025 12:29:23 -0800 Subject: [PATCH 29/46] Use the actual JRUBY_REVISION and commit in release note (#8) Co-authored-by: Benoit Daloze --- .github/workflows/build.yml | 62 ++++++++++++++------------- Gemfile | 5 +-- find-jruby-head-url.rb | 84 ------------------------------------- test/Gemfile | 5 +++ 4 files changed, 38 insertions(+), 118 deletions(-) delete mode 100644 find-jruby-head-url.rb create mode 100644 test/Gemfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3effea..7819c67 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,34 +8,34 @@ on: - cron: '0 19 * * *' jobs: prepare: - name: Check if the latest jruby commit is already built + name: Check if the latest jruby snapshot is already built runs-on: ubuntu-latest outputs: should_build: ${{ steps.check_commit.outputs.result }} - commit: ${{ steps.latest_commit.outputs.commit }} + url: ${{ steps.url.outputs.url }} steps: - - name: Clone jruby + - name: Clone to get find-jruby-head-url-nokogiri.rb uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: - repository: jruby/jruby - path: jruby - - name: Set latest_commit - id: latest_commit - working-directory: jruby - run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - + ruby-version: ruby + bundler-cache: true + - name: Get latest jruby nightly archive url + id: url + run: | + echo "url=$(bundle exec ruby find-jruby-head-url-nokogiri.rb)" | tee -a "$GITHUB_OUTPUT" - name: Check if latest commit already built uses: actions/github-script@v7 id: check_commit with: script: | - const latestDevCommit = "${{ steps.latest_commit.outputs.commit }}" + const latestSnapshotUrl = "${{ steps.url.outputs.url }}" const { owner, repo } = context.repo let { data: release } = await github.rest.repos.getLatestRelease({ owner, repo }) - const latestReleaseCommit = release.body.split('@')[1] - console.log(`Latest release commit: ${latestReleaseCommit}`) - console.log(`Latest jruby commit: ${latestDevCommit}`) - if (latestReleaseCommit === latestDevCommit) { + const latestTaggedUrl = release.body.split(/\s+/)[1] + console.log(`Latest snapshot url: ${latestSnapshotUrl}`) + console.log(`Latest tagged url: ${latestTaggedUrl}`) + if (latestSnapshotUrl === latestTaggedUrl) { return 'false' } else { return 'true' @@ -45,8 +45,7 @@ jobs: release: name: Create GitHub Release needs: [prepare] - # We don't build JRuby from the repo commit but from latest maven snapshort, so always run - # if: needs.prepare.outputs.should_build == 'true' + if: needs.prepare.outputs.should_build == 'true' runs-on: ubuntu-latest outputs: tag: ${{ steps.tag.outputs.tag }} @@ -71,8 +70,7 @@ jobs: GH_REPO: ${{ github.repository }} run: | tag="${{ steps.tag.outputs.tag }}" - body="jruby/jruby@${{ needs.prepare.outputs.commit }}" - gh release create --draft "$tag" --title "$tag" --notes "$body" + gh release create --draft "$tag" --title "$tag" build: needs: [prepare, release] @@ -81,6 +79,8 @@ jobs: matrix: os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019 ] runs-on: ${{ matrix.os }} + outputs: + commit: ${{ steps.latest_commit.outputs.commit }} steps: - name: Set platform id: platform @@ -94,18 +94,11 @@ jobs: echo "platform=$platform" >> $GITHUB_OUTPUT # Build - - name: Clone this repo to get find-jruby-head-url-nokogiri.rb + - name: Clone to get test/Gemfile uses: actions/checkout@v4 - - uses: ruby/setup-ruby@master - with: - ruby-version: ruby - name: Download latest jruby nightly archive shell: bash - run: | - gem install nokogiri - url=$(ruby find-jruby-head-url-nokogiri.rb) - echo "$url" - curl --fail -L -o jruby-head.tar.gz "$url" + run: curl --fail -L -o jruby-head.tar.gz "${{ needs.prepare.outputs.url }}" - uses: eregon/clean-path@v1 with: regexp: '\bruby\b' @@ -157,8 +150,15 @@ jobs: - run: ruby -ropen-uri -e 'puts URI.send(:open, %{https://rubygems.org/}) { |f| f.read(1024) }' - run: gem install json:2.2.0 --no-document - run: bundle --version + working-directory: test - run: bundle install + working-directory: test - run: bundle exec rake --version + working-directory: test + + - name: Set latest_commit + id: latest_commit + run: echo "commit=$(ruby -e 'puts JRUBY_REVISION')" >> $GITHUB_OUTPUT - name: Upload Built Ruby env: @@ -168,14 +168,16 @@ jobs: publish: name: Publish Release - needs: [release, build] + needs: [prepare, release, build] runs-on: ubuntu-latest steps: - name: Publish Release env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} - run: gh release edit "${{ needs.release.outputs.tag }}" --draft=false + run: | + body="jruby/jruby@${{ needs.build.outputs.commit }} ${{ needs.prepare.outputs.url }}" + gh release edit "${{ needs.release.outputs.tag }}" --draft=false --notes "$body" - uses: eregon/keep-last-n-releases@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile b/Gemfile index 0012c31..bcf5c12 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,3 @@ -# Used for testing source 'https://rubygems.org' -gem "rake" -gem "path" -gem "json", "2.2.0" +gem 'nokogiri' diff --git a/find-jruby-head-url.rb b/find-jruby-head-url.rb deleted file mode 100644 index bcfc3bf..0000000 --- a/find-jruby-head-url.rb +++ /dev/null @@ -1,84 +0,0 @@ -require 'open-uri' -require 'rubygems' - -module MicroXMLParser - HEADER = %r{<\?xml\s.+\?>\n} - ATTRIBUTE = %r{(\w+)="([^"]+)"} - OPEN_TAG = %r{<(\w+)((?:\s+#{ATTRIBUTE})*)>} - CLOSE_TAG = %r{} - TEXT = %r{([^<]*)} - - def self.parse(xml) - xml = xml.strip - raise xml unless xml.start_with? HEADER - xml = xml[$&.size..-1].strip - value, rest = rec(xml) - raise rest unless rest.empty? - value - end - - def self.rec(xml) - xml = xml.strip - if xml.start_with? OPEN_TAG - entries = [] - while xml.start_with? OPEN_TAG - tag, attributes = $1, $2 - xml = xml[$&.size..-1].strip - - until attributes.empty? - attributes = attributes.strip - raise attributes unless attributes.start_with? ATTRIBUTE - key, value = $1, $2 - attributes = attributes[$&.size..-1] - entries << { key.to_sym => value } - end - - value, xml = rec(xml) - entries << { tag.to_sym => value } - - close_tag = "" - raise "Missing close tag #{close_tag}: #{xml}" unless xml.start_with? close_tag - xml = xml[close_tag.size..-1].strip - end - - keys = entries.map { |entry| entry.first.first } - if keys == keys.uniq - entries = entries.inject({}, :merge) - end - - [entries, xml] - elsif xml.start_with? TEXT - text = $1 - xml = xml[$&.size..-1] - [text, xml] - else - raise xml - end - end -end - -base_url = 'https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-dist' -index_url = "#{base_url}/maven-metadata.xml" - -STDERR.puts index_url -xml = URI.open(index_url, &:read) -STDERR.puts xml - -parsed = MicroXMLParser.parse(xml) -versions = parsed.dig(:metadata, :versioning, :versions).map { |e| e[1] } - -versions.delete('9000.dev-SNAPSHOT') -most_recent = versions.max_by { |v| Gem::Version.new(v) } - -builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" -STDERR.puts builds_url -xml = URI.open(builds_url, &:read) -STDERR.puts xml - -parsed = MicroXMLParser.parse(xml) -last_build = parsed.dig(:metadata, :versioning, :snapshotVersions).map { |e| e[:snapshotVersion] }.select { |node| - node[:classifier] == 'bin' and node[:extension] == 'tar.gz' -}.map { |node| node[:value] }.last - -final_url = "#{base_url}/#{most_recent}/jruby-dist-#{last_build}-bin.tar.gz" -puts final_url diff --git a/test/Gemfile b/test/Gemfile new file mode 100644 index 0000000..9900a98 --- /dev/null +++ b/test/Gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'rake' +gem 'path' +gem 'json', '2.2.0' From e141b5493c824b03f5a2d03b57c12282fc181c1b Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Mon, 3 Mar 2025 16:16:02 -0600 Subject: [PATCH 30/46] Pin dev builds to 9.4 for now JRuby 10 is about to become the new "jruby-head" but we want to ease into that transition. This PR filters available snapshot versions to just "9.4" releases until we are ready to support 10. --- find-jruby-head-url-nokogiri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-jruby-head-url-nokogiri.rb b/find-jruby-head-url-nokogiri.rb index dfd0710..dffd3d4 100644 --- a/find-jruby-head-url-nokogiri.rb +++ b/find-jruby-head-url-nokogiri.rb @@ -12,7 +12,7 @@ versions = Nokogiri::XML(xml).css('version').map(&:text) versions.delete('9000.dev-SNAPSHOT') -most_recent = versions.max_by { |v| Gem::Version.new(v) } +most_recent = versions.grep(/9\.4/).max_by { |v| Gem::Version.new(v) } builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" STDERR.puts builds_url From 0d640bbb795b1c1dd22a16f6472ce26e4162953c Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 4 Mar 2025 10:16:16 -0600 Subject: [PATCH 31/46] Narrow the 9.4 check to avoid false positives See discussion at https://github.com/ruby/jruby-dev-builder/pull/9#pullrequestreview-2656758475 --- find-jruby-head-url-nokogiri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-jruby-head-url-nokogiri.rb b/find-jruby-head-url-nokogiri.rb index dffd3d4..d2565eb 100644 --- a/find-jruby-head-url-nokogiri.rb +++ b/find-jruby-head-url-nokogiri.rb @@ -12,7 +12,7 @@ versions = Nokogiri::XML(xml).css('version').map(&:text) versions.delete('9000.dev-SNAPSHOT') -most_recent = versions.grep(/9\.4/).max_by { |v| Gem::Version.new(v) } +most_recent = versions.grep(/^9\.4/).max_by { |v| Gem::Version.new(v) } builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" STDERR.puts builds_url From 4e039edfdee008845477de760bdaf47483689126 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 13 Mar 2025 06:52:24 +0100 Subject: [PATCH 32/46] Switch back to jruby master (#10) * Revert "Narrow the 9.4 check to avoid false positives" This reverts commit 0d640bbb795b1c1dd22a16f6472ce26e4162953c. * Revert "Pin dev builds to 9.4 for now" This reverts commit e141b5493c824b03f5a2d03b57c12282fc181c1b. --- find-jruby-head-url-nokogiri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-jruby-head-url-nokogiri.rb b/find-jruby-head-url-nokogiri.rb index d2565eb..dfd0710 100644 --- a/find-jruby-head-url-nokogiri.rb +++ b/find-jruby-head-url-nokogiri.rb @@ -12,7 +12,7 @@ versions = Nokogiri::XML(xml).css('version').map(&:text) versions.delete('9000.dev-SNAPSHOT') -most_recent = versions.grep(/^9\.4/).max_by { |v| Gem::Version.new(v) } +most_recent = versions.max_by { |v| Gem::Version.new(v) } builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" STDERR.puts builds_url From a4cdaa60a48c4bfb237f6071f950752ec59ec6e0 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 13 Mar 2025 01:00:50 -0500 Subject: [PATCH 33/46] Switch to Java 21 before verifying JRuby JRuby requires Java 21 now. --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7819c67..fed015f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,6 +143,11 @@ jobs: if: startsWith(matrix.os, 'windows') - run: echo $Env:Path + - name: switch to Java 21 for verification + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 21 - run: ruby --version - run: ruby -e 'raise unless RUBY_ENGINE == %{jruby}' - run: gem --version From 63a6629cfb9964afcef35d74a3e9e8f02fd276ff Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 13 Mar 2025 14:34:39 -0500 Subject: [PATCH 34/46] Revert JRuby 10 change temporarily This reverts commit 4e039edfdee008845477de760bdaf47483689126. Only reverting because there's nobody to release setup-ruby and the released version does not work with jruby-head as 10. --- find-jruby-head-url-nokogiri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-jruby-head-url-nokogiri.rb b/find-jruby-head-url-nokogiri.rb index dfd0710..d2565eb 100644 --- a/find-jruby-head-url-nokogiri.rb +++ b/find-jruby-head-url-nokogiri.rb @@ -12,7 +12,7 @@ versions = Nokogiri::XML(xml).css('version').map(&:text) versions.delete('9000.dev-SNAPSHOT') -most_recent = versions.max_by { |v| Gem::Version.new(v) } +most_recent = versions.grep(/^9\.4/).max_by { |v| Gem::Version.new(v) } builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" STDERR.puts builds_url From fac80d88af41bbc660d921e63bcac0a2d0ddbdb3 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 13 Mar 2025 21:06:10 +0100 Subject: [PATCH 35/46] Revert "Revert JRuby 10 change temporarily" This reverts commit 63a6629cfb9964afcef35d74a3e9e8f02fd276ff. --- find-jruby-head-url-nokogiri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-jruby-head-url-nokogiri.rb b/find-jruby-head-url-nokogiri.rb index d2565eb..dfd0710 100644 --- a/find-jruby-head-url-nokogiri.rb +++ b/find-jruby-head-url-nokogiri.rb @@ -12,7 +12,7 @@ versions = Nokogiri::XML(xml).css('version').map(&:text) versions.delete('9000.dev-SNAPSHOT') -most_recent = versions.grep(/^9\.4/).max_by { |v| Gem::Version.new(v) } +most_recent = versions.max_by { |v| Gem::Version.new(v) } builds_url = "#{base_url}/#{most_recent}/maven-metadata.xml" STDERR.puts builds_url From 3aec31faffe38e0ed938f58d0c03857fa7c977fc Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 24 Apr 2025 13:44:43 +0200 Subject: [PATCH 36/46] Use the same JDK 21 as ruby-builder and setup-ruby --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fed015f..87ada5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -144,10 +144,8 @@ jobs: - run: echo $Env:Path - name: switch to Java 21 for verification - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 21 + run: echo "JAVA_HOME=${JAVA_HOME_21_X64:-${JAVA_HOME_21_arm64:-}}" >> "$GITHUB_ENV" + shell: bash - run: ruby --version - run: ruby -e 'raise unless RUBY_ENGINE == %{jruby}' - run: gem --version From e1d61f2a7681b86450694b7b0e688276f3a30637 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 24 Apr 2025 13:45:23 +0200 Subject: [PATCH 37/46] Remove ubuntu-20.04 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87ada5b..8455d09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019 ] + os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019 ] runs-on: ${{ matrix.os }} outputs: commit: ${{ steps.latest_commit.outputs.commit }} From 369d0d53cb5a2d8fe00a6cc4686701eb8ddcc328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Fri, 18 Apr 2025 08:14:41 -0700 Subject: [PATCH 38/46] Add jruby on windows-11-arm --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8455d09..5c5e075 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019 ] + os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019, windows-11-arm ] runs-on: ${{ matrix.os }} outputs: commit: ${{ steps.latest_commit.outputs.commit }} @@ -89,8 +89,8 @@ jobs: platform=${{ matrix.os }} platform=${platform/macos-13/macos-latest} platform=${platform/macos-14/macos-13-arm64} - platform=${platform/%-arm/-arm64} - platform=${platform/windows-*/windows-latest} + platform=${platform/windows-2019/windows-latest} + platform=${platform/windows-11-arm/windows-arm64} echo "platform=$platform" >> $GITHUB_OUTPUT # Build From 5e538fb22f5a827a19b9e6d1b70805e95c9d20db Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 25 Apr 2025 11:06:27 +0200 Subject: [PATCH 39/46] Remove windows-11-arm until there is a preinstalled native JDK 21 on that image * See https://github.com/ruby/jruby-dev-builder/pull/14#issuecomment-2829816063 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c5e075..ebfdab9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019, windows-11-arm ] + os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019 ] runs-on: ${{ matrix.os }} outputs: commit: ${{ steps.latest_commit.outputs.commit }} From 841382ecf34207d4dbf921557e4c8fc2fa02f28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 24 Apr 2025 13:54:18 -0700 Subject: [PATCH 40/46] Fix arm to arm64 normalization for ubuntu --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebfdab9..6ce93ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,6 +91,7 @@ jobs: platform=${platform/macos-14/macos-13-arm64} platform=${platform/windows-2019/windows-latest} platform=${platform/windows-11-arm/windows-arm64} + platform=${platform/%-arm/-arm64} echo "platform=$platform" >> $GITHUB_OUTPUT # Build From 93ef02b88d961ba09947b116f8c9de408a0783e0 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 26 Jun 2025 09:24:40 -0500 Subject: [PATCH 41/46] Use new maven snapshot URL --- find-jruby-head-url-nokogiri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-jruby-head-url-nokogiri.rb b/find-jruby-head-url-nokogiri.rb index dfd0710..a2f9e0b 100644 --- a/find-jruby-head-url-nokogiri.rb +++ b/find-jruby-head-url-nokogiri.rb @@ -2,7 +2,7 @@ require 'rubygems' require 'nokogiri' -base_url = 'https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-dist' +base_url = 'https://central.sonatype.com/repository/maven-snapshots/org/jruby/jruby-dist' index_url = "#{base_url}/maven-metadata.xml" STDERR.puts index_url From 7c7bcb391bd7ef9df64fb44c15908efac42b138e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 21 Jul 2025 21:34:50 +0200 Subject: [PATCH 42/46] windows-2019 -> windows-2022 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ce93ea..ae52f11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2019 ] + os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2022 ] runs-on: ${{ matrix.os }} outputs: commit: ${{ steps.latest_commit.outputs.commit }} @@ -89,7 +89,7 @@ jobs: platform=${{ matrix.os }} platform=${platform/macos-13/macos-latest} platform=${platform/macos-14/macos-13-arm64} - platform=${platform/windows-2019/windows-latest} + platform=${platform/windows-2022/windows-latest} platform=${platform/windows-11-arm/windows-arm64} platform=${platform/%-arm/-arm64} echo "platform=$platform" >> $GITHUB_OUTPUT From b3ce8c0bb7b94fbeb0db29d72f3206c1de4530c5 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Mon, 21 Jul 2025 14:24:10 -0500 Subject: [PATCH 43/46] Don't manipulate bin scripts for jruby/ruby In jruby/jruby#8875 we modified JRuby's distribution to always ship scripts for bin/jruby and bin/ruby: * bin/jruby and bin/ruby are versioned shell scripts that launch `/bin/sh bin/jruby.sh`. * bin/ruby.bat contains batch code to launch bin/ruby.exe. * No copying of scripts is done during the build and no tweaks are needed by installers to copy, link, or create additional bin/ commands. These changes now conflict with jruby-dev-builder's symlinking of bin/jruby to bin/ruby and its creation of bin/ruby.bat, so we remove the relevant steps. --- .github/workflows/build.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae52f11..bfa4644 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,21 +115,6 @@ jobs: ls -l jruby-*-SNAPSHOT/bin mv jruby-*-SNAPSHOT jruby-head ls -l jruby-head/bin - - name: Add ruby alias - if: "!startsWith(matrix.os, 'windows')" - run: | - cd jruby-head/bin - ln -s jruby ruby - - name: Add ruby alias (Windows) - if: startsWith(matrix.os, 'windows') - shell: bash - run: | - cd jruby-head/bin - # Copy bash launcher, so 'ruby' works in bash - cp jruby ruby - # Create ruby.bat, so 'ruby' works in pwsh - echo -en "@ECHO OFF\r\n@\"%~dp0jruby.exe\" %*\r\n" > ruby.bat - ls -l - name: Create archive run: tar czf jruby-head-${{ steps.platform.outputs.platform }}.tar.gz jruby-head From c7591d4dd937c34185e1909f8a9f66eec7780921 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 21 Jul 2025 22:03:00 +0200 Subject: [PATCH 44/46] Add note and remove redundant ls -l --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfa4644..3631728 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,6 +105,7 @@ jobs: regexp: '\bruby\b' - run: tar xf jruby-head.tar.gz if: "!startsWith(matrix.os, 'windows')" + # NOTE: Keep the logic from here in sync with ruby-builder's buildJRubyWindows job # Extracting must be done in the native shell: https://github.com/MSP-Greg/ruby-setup-ruby/issues/1 # We need to use to use the system tar, the Git tar seems basically broken - run: C:\windows\system32\tar.exe xf jruby-head.tar.gz @@ -112,7 +113,6 @@ jobs: - name: Rename to jruby-head shell: bash run: | - ls -l jruby-*-SNAPSHOT/bin mv jruby-*-SNAPSHOT jruby-head ls -l jruby-head/bin - name: Create archive From 876079356c56cf100bceb8640c4e419b2962a392 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 21 Jul 2025 22:29:21 +0200 Subject: [PATCH 45/46] Sync logic with ruby-builder --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3631728..33aca57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,12 +107,14 @@ jobs: if: "!startsWith(matrix.os, 'windows')" # NOTE: Keep the logic from here in sync with ruby-builder's buildJRubyWindows job # Extracting must be done in the native shell: https://github.com/MSP-Greg/ruby-setup-ruby/issues/1 - # We need to use to use the system tar, the Git tar seems basically broken + # We need to use to use the system tar, the Git tar seems basically broken. + # And `mv dir /c/...` also removes jruby.exe, so we need to avoid that. - run: C:\windows\system32\tar.exe xf jruby-head.tar.gz if: startsWith(matrix.os, 'windows') - - name: Rename to jruby-head + - name: Check bin/ and rename to jruby-head shell: bash run: | + ls -l jruby-*-SNAPSHOT/bin mv jruby-*-SNAPSHOT jruby-head ls -l jruby-head/bin - name: Create archive From 8e17c66e6cbd558dcaf62dc71207b08f9e38dfc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Mon, 11 Aug 2025 17:54:42 -0700 Subject: [PATCH 46/46] Add JRuby for Windows on Arm --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33aca57..da39e8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2022 ] + os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, windows-2022, windows-11-arm ] runs-on: ${{ matrix.os }} outputs: commit: ${{ steps.latest_commit.outputs.commit }} @@ -131,8 +131,11 @@ jobs: if: startsWith(matrix.os, 'windows') - run: echo $Env:Path + # JAVA_HOME_21_AARCH64 - https://github.com/actions/partner-runner-images/blob/main/images/arm-windows-11-image.md#java + # JAVA_HOME_21_arm64 - https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md#java + # JAVA_HOME_21_X64 - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java - name: switch to Java 21 for verification - run: echo "JAVA_HOME=${JAVA_HOME_21_X64:-${JAVA_HOME_21_arm64:-}}" >> "$GITHUB_ENV" + run: echo "JAVA_HOME=${JAVA_HOME_21_AARCH64:-${JAVA_HOME_21_arm64:-${JAVA_HOME_21_X64:-}}}" >> "$GITHUB_ENV" shell: bash - run: ruby --version - run: ruby -e 'raise unless RUBY_ENGINE == %{jruby}'