Skip to content

Automated Releases#252

Merged
bensheldon merged 20 commits into
mainfrom
project-improvements
Feb 21, 2025
Merged

Automated Releases#252
bensheldon merged 20 commits into
mainfrom
project-improvements

Conversation

@GrantBirki

@GrantBirki GrantBirki commented Feb 17, 2025

Copy link
Copy Markdown
Contributor

Automated Releases

This pull request implements automated releases to RubyGems and GitHub Packages for the github/rubocop-github project. This is accomplished by adding a new release workflow. We use this same workflow for other RubyGems here at GitHub (ex: github/redacting-logger and github/entitlements-app).

Going forward, rather than having to manually release (and have access to RubyGems), CI will handle this for us automatically. Simply updating the lib/version.rb file and running bundle is all that is required to trigger a new release. When changes merge into main where lib/version.rb has been modified, the release workflow starts, and ships your changes for you 🎉.

@GrantBirki GrantBirki changed the title Project Improvements Feb 19, 2025
@GrantBirki GrantBirki marked this pull request as ready for review February 19, 2025 06:16
Copilot AI review requested due to automatic review settings February 19, 2025 06:16
@GrantBirki GrantBirki requested a review from a team as a code owner February 19, 2025 06:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request automates the release process for the rubocop-github project by introducing workflows that build, test, lint, and release the gem to RubyGems and GitHub Packages. Key changes include:

  • Addition of a build workflow (.github/workflows/build.yml) that builds the gem.
  • Introduction of a release workflow (.github/workflows/release.yml) that sets the gem’s version, publishes the gem, and releases it on GitHub.
  • Addition of a lint workflow (.github/workflows/lint.yml) and updates to the CI workflow (.github/workflows/ci.yml).
  • Updates to lib/version.rb, rubocop-github.gemspec, and CONTRIBUTING.md to align with the new automated release process.

Changes

File Description
.github/workflows/build.yml Adds build workflow for building the gem
.github/workflows/release.yml Adds release workflow for publishing and releasing the gem
.github/workflows/lint.yml Introduces a linting workflow
.github/workflows/ci.yml Updates CI workflow to trigger on push and pull requests
lib/version.rb Defines the gem version
CONTRIBUTING.md Updates contribution guidelines to reflect new release process
rubocop-github.gemspec Uses the version from lib/version.rb and adds metadata

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

.github/workflows/build.yml:34

  • The command to set GEM_NAME may behave unexpectedly if multiple gemspec files exist; consider using a more specific file matching pattern or explicitly specifying the gemspec file to avoid ambiguity.
GEM_NAME=$(ls | grep gemspec | cut -d. -f1)

.github/workflows/release.yml:38

  • The nested double quotes inside the 'tr -d' command may cause shell syntax issues; consider escaping the inner quotes or using an alternative quoting mechanism to ensure the command executes correctly.
echo "GEM_VERSION=$(gem build ${{ env.GEM_NAME }}.gemspec 2>&1 | grep Version | cut -d':' -f 2 | tr -d " \t\n\r")" >> $GITHUB_ENV

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/release.yml Outdated
@bensheldon bensheldon merged commit 2aa67be into main Feb 21, 2025
@bensheldon bensheldon deleted the project-improvements branch February 21, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants