Skip to content

build: semi-automated release process#80

Open
extern-c wants to merge 10 commits into
CycloneDX:masterfrom
extern-c:ci-release
Open

build: semi-automated release process#80
extern-c wants to merge 10 commits into
CycloneDX:masterfrom
extern-c:ci-release

Conversation

@extern-c

@extern-c extern-c commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

Add a release workflow for RubyGems and GitHub Releases triggered by version tags (v*).

This PR resolves issue: #46.

The workflow consists of three jobs:

  1. Test: runs the test suite using Ruby 3.3.
  2. RubyGems Release: publishes the gem to RubyGems using trusted publishing.
  3. GitHub Release: creates a GitHub Release with generated release notes.

The GitHub Release does not include a built gem package and is intended only for release metadata and assets.

Future Improvements

To keep this change focused, a few related enhancements are left for follow-up work:

  • Verify that the gem version matches the release tag before publishing.
  • Ensure the tagged commit is reachable from a protected release branch (e.g. main) before publishing to reduce the risk of releasing from an unreviewed commit outside the normal development workflow.
  • Generate and publish SHA hashes for release assets.
  • Document the release process (e.g. updating the gem version, creating and publishing a release tag, and publishing a release).

Release documentation will be added in a follow-up PR.

Testing

The workflow has been validated to the extent possible, but I was unable to perform an end-to-end test for the RubyGems publishing step because trusted publishing requires maintainer-controlled RubyGems and repository configuration.

A maintainer will need to:

  • Create and configure a release environment if one does not already exist.
  • Configure RubyGems trusted publishing for the repository/environment.
  • Perform a test release to verify that the trusted publishing configuration is set up correctly.

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@extern-c extern-c force-pushed the ci-release branch 3 times, most recently from f94b6a6 to e19047f Compare July 1, 2026 03:44
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
@extern-c extern-c marked this pull request as ready for review July 2, 2026 23:30
@extern-c extern-c requested a review from a team as a code owner July 2, 2026 23:30
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>

@jkowalleck jkowalleck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the release process looks very promising. 👍

Release documentation will be added in a follow-up PR.

Docs shall happen when changes happen.

Could you please add some docs how this all works and how it is triggered?
This might go here: CONTRIBUTING.md section "To release a new version".
You might want to remove the "Manual process" and add a "Semi-Automated process" or whatever sounds appropriate

please also add a description of the build changes to CHANGELOG.md

needs: rubygems_release
environment: release
permissions:
contents: write

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please add a comment why this permission is needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in e3c2541. Thanks for the suggestion.

Comment thread .github/workflows/release.yml Outdated
timeout-minutes: 10
needs: test
permissions:
contents: write

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please add comments why the permissions are needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 51b50f1. Thanks for the suggestion.

Comment thread .github/workflows/release.yml Outdated
persist-credentials: false
- name: Create GitHub Release
run: |
gh release create "${{ github.ref_name }}" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
gh release create "${{ github.ref_name }}" \
gh release create "$GITHUB_REF_NAME" \

see

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 2106cb1. Thanks for the suggestion.

with:
persist-credentials: false
- name: Create GitHub Release
run: |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please rework this to

run: >
  gh release create ...
  --verify-tag
  ...

ruby-version: ruby
bundler-cache: false
- name: "Push gem to RubyGems"
uses: rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please add a comment with the action's URL for easier docks lookup when maintaining.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in da61dd3. Thanks for the suggestion.

Comment thread .github/workflows/release.yml Outdated
run: |
gh release create "${{ github.ref_name }}" \
--verify-tag \
--generate-notes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd love to see the "--prerelease" marker in case the tag looks like one.
This will be especially needed to test the release process before merging the PR.

Possible way to do this: similar to https://github.com/CycloneDX/cyclonedx-buildroot/blob/main/.github/workflows/release.yml

  1. add a new job that determines whether this is a prerelease
  • do a pattern-math on the version string
  • set an output parameter properly
  1. have the release process depend on the newly added job
  2. when creating the GH release: reflect on the outcome and flag as prerelease if needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Implemented in 9e50640.

Comment thread .github/workflows/release.yml Outdated

on:
push:
tags: ["v*"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe better go with

Suggested change
tags: ["v*"]
tags: ["v*.*.*"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 3e9e0ba. Thanks for the suggestion.

uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Create GitHub Release

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could the release have the gem as a release asset?
It would be ideal to use the one produced in the rubygems_release job - you could use https://docs.github.com/en/actions/concepts/workflows-and-actions/workflow-artifacts to transfer a file from one job to the other. (artifact lifetime of 1 day should be enough)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would you be okay with deferring this for now? I don't think it's necessary to include the built gem in the GitHub release since it'll already be published to RubyGems, and anyone can build it from the release assets. AFAIK, rubygems/release-gem does not produce a build artifact, so we'd need to add additional steps to build the gem and upload it separately.

@jkowalleck jkowalleck changed the title Add release workflow build: semi-automated release process Jul 3, 2026
extern-c added 3 commits July 4, 2026 11:20
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
extern-c added 3 commits July 4, 2026 19:17
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
Signed-off-by: Amauri Bizerra <10775696+extern-c@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants