From f0754bdacf9786700f3c2814ef18c9e0c880fc6f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 16 Nov 2021 19:22:05 +0900 Subject: [PATCH 01/10] Fix commit_bump --- rakelib/version.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rakelib/version.rake b/rakelib/version.rake index c56ea56..bbb327f 100644 --- a/rakelib/version.rake +++ b/rakelib/version.rake @@ -12,7 +12,7 @@ class << (helper = Bundler::GemHelper.instance) end def commit_bump - sh(%W[git -C #{__dir__} commit -m bump\ up\ to\ #{gemspec.version} + sh(%W[git commit -m bump\ up\ to\ #{gemspec.version} #{gemspec.loaded_from}]) end From b73d1d72e0576f454579b51e015e1920927d0e2a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 25 Mar 2022 16:47:31 +0900 Subject: [PATCH 02/10] Added dependabot (#20) --- .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 120c3bb220d8b743a44d073b5af84de16fa59a4b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 04:23:34 +0000 Subject: [PATCH 03/10] Bump actions/upload-artifact from 2 to 3 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2aae1ac..f93aa83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,7 @@ jobs: if: "matrix.ruby == '3.0'" shell: bash - name: Upload package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: pkg/*.gem name: ${{steps.build.outputs.pkg}} From 3882dac4c9bc784183d7d4cf7374edd56017746f Mon Sep 17 00:00:00 2001 From: Junichi Sato <22004610+sato11@users.noreply.github.com> Date: Sat, 21 Jan 2023 15:28:46 +0900 Subject: [PATCH 04/10] Use GITHUB_OUTPUT instead of deprecated set-output (#22) --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f93aa83..3bd301d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,14 +27,14 @@ jobs: id: bundle run: | bundle install - echo "::set-output name=exec::bundle exec" + echo "exec=bundle exec" >> $GITHUB_OUTPUT if: "matrix.ruby <= '2.1'" - name: Run test run: ${{steps.bundle.outputs.exec}} rake test - id: build run: | rake build - echo "::set-output name=pkg::${GITHUB_REPOSITORY#*/}-${RUNNING_OS%-*}" + echo "pkg=${GITHUB_REPOSITORY#*/}-${RUNNING_OS%-*}" >> $GITHUB_OUTPUT env: RUNNING_OS: ${{matrix.os}} if: "matrix.ruby == '3.0'" From 9d9f84978a53c62fd6d3befb56ea59ede700e0bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 04:46:35 +0000 Subject: [PATCH 05/10] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bd301d..b1c365e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,7 @@ jobs: if: "matrix.ruby == '3.0'" shell: bash - name: Upload package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: pkg/*.gem name: ${{steps.build.outputs.pkg}} From 947bad9f47a803c5bb678ee8b0f2f448f921601b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 30 May 2025 15:56:43 +0900 Subject: [PATCH 06/10] Use ruby_versions.yml --- .github/workflows/test.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1c365e..3df4654 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,14 +3,28 @@ name: test on: [push, pull_request] jobs: + ruby-versions: + uses: ruby/actions/.github/workflows/ruby_versions.yml@master + with: + engine: cruby + min_version: 2.1 + build: + needs: ruby-versions name: build (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: matrix: - ruby: [ '3.0', 2.7, 2.6, 2.1, head, truffleruby-head ] + ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} os: [ ubuntu-latest, macos-latest, windows-latest ] + include: + - { os: ubuntu-latest, ruby: truffleruby-head } + - { os: macos-latest, ruby: truffleruby-head } exclude: - - { os: windows-latest, ruby: truffleruby-head } + - { os: macos-latest, ruby: 2.1 } + - { os: macos-latest, ruby: 2.2 } + - { os: macos-latest, ruby: 2.3 } + - { os: macos-latest, ruby: 2.4 } + - { os: macos-latest, ruby: 2.5 } runs-on: ${{ matrix.os }} steps: - name: git config From 7c555d20b224682900ed34c7cecf39bad747ca1b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 30 May 2025 16:01:45 +0900 Subject: [PATCH 07/10] Always use bundle exec --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3df4654..be0eaf0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,10 +41,9 @@ jobs: id: bundle run: | bundle install - echo "exec=bundle exec" >> $GITHUB_OUTPUT if: "matrix.ruby <= '2.1'" - name: Run test - run: ${{steps.bundle.outputs.exec}} rake test + run: bundle exec rake test - id: build run: | rake build From 80ab4bf53d1a5df335a0209b0495f385a88826df Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 30 May 2025 16:04:37 +0900 Subject: [PATCH 08/10] Use bundler-cache instead of bundle install --- .github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be0eaf0..5932c89 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,11 +37,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - name: Install - id: bundle - run: | - bundle install - if: "matrix.ruby <= '2.1'" + bundler-cache: true - name: Run test run: bundle exec rake test - id: build From 05be175c4e8f5307ea75ece34a9dc27a2ad84138 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 30 May 2025 15:37:19 +0900 Subject: [PATCH 09/10] Enabled trusted publisher for rubygems.org --- .github/workflows/push_gem.yml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/push_gem.yml diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml new file mode 100644 index 0000000..f662094 --- /dev/null +++ b/.github/workflows/push_gem.yml @@ -0,0 +1,46 @@ +name: Publish gem to rubygems.org + +on: + push: + tags: + - 'v*' + +permissions: + contents: read + +jobs: + push: + if: github.repository == 'ruby/ruby2_keywords' + runs-on: ubuntu-latest + + environment: + name: rubygems.org + url: https://rubygems.org/gems/ruby2_keywords + + permissions: + contents: write + id-token: write + + steps: + - name: Harden Runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Ruby + uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 + with: + bundler-cache: true + ruby-version: "ruby" + + - name: Publish to RubyGems + uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1 + + - name: Create GitHub release + run: | + tag_name="$(git describe --tags --abbrev=0)" + gh release create "${tag_name}" --verify-tag --generate-notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8abbcef5e4b2468f9cc7291b9ad492c0a27425ad Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 30 May 2025 15:37:33 +0900 Subject: [PATCH 10/10] Ignore pkg directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6c2c094..230b7e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ ChangeLog logs/ gems.locked +pkg/