Skip to main content
All posts
Engineering

How we automated multi-component releases with GitHub Actions

Arkadiusz Kwasigroch

Arkadiusz Kwasigroch

• 8 min read

How we automated multi-component releases with GitHub Actions

Releasing was a pain

Every release of the rhesis.ai app meant a release manager following a detailed, multi-step procedure from start to finish. It was tedious — it always involved setting up environment variables, running scripts in a specific order, and triggering the deployment of each application component. Whenever someone new joined, they had to be taught the whole thing from scratch. The process was time-consuming, error-prone, and onboarding a new release manager took forever.

We needed a better way. A faster process would also allow us to release more often, which matters when you need to push bug fixes and updates to users quickly.

In this post, we describe how we automated the whole thing by scripting all the steps and leveraging GitHub Actions. We cover how we automatically create release branches, deploy the application, generate release notes, and publish releases on GitHub. We also share the rough edges we hit along the way with GitHub Actions. The goal was simple: less human intervention, more automation, and keep it as simple as possible.

Workflow

The release process involves more than just scripts; it encompasses team rules and workflow. Initially, our workflow was simple: we merged feature branches into the main branch. On release day, we tested the application and fixed any bugs directly in main. The main branch was then deployed to production at the end of the day.

A major drawback of this approach was that the main branch was blocked for the entire day. No merges were allowed (except for hotfixes) until the release was deployed. To address this, we introduced a dedicated release branch. This branch is created in the morning, and all necessary hotfixes are merged into it, keeping the main branch unblocked for ongoing development.

The GitHub Actions

We are an open source project and we use GitHub — you can see our work at github.com/rhesis-ai/rhesis. So the choice was natural: GitHub Actions.

We came up with a four-stage process. Three stages are automated via GitHub Actions; the third is a manual testing step:

  • Stage 1: Configure what to release (automated) — a manually triggered workflow where you define what goes into the release.
  • Stage 2: Create the release branch and deploy to staging (automated) — creates the branch, opens a pull request, and deploys to staging.
  • Stage 3: Testing and hotfixes (manual) — the team tests on staging and merges any fixes into the release branch.
  • Stage 4: Publish to production + PyPI (automated) — once everything looks good, the final action pushes to production and publishes to PyPI.
Release workflow schema showing the four stages: configure, create branch and deploy to staging, testing, and publish to production
Overview of the four-stage release workflow.

Stage 1 — Set up release config (manually)

This action has to be triggered manually before the release. The release manager sets up the version bumps for every component. It creates a JSON file in the root of the repository with the components and their corresponding bumps.

GitHub Actions workflow dispatch UI showing version bump dropdowns for each component

The workflow UI for picking version bumps.

{
  "platform": "patch",
  "backend": "patch",
  "frontend": "patch",
  "sdk": "patch",
  "polyphemus": "patch"
}

release-config.json

We considered storing this configuration in GitHub variables instead, but that turned out to be a worse option. It's hidden deep in the settings and not transparent at all. A JSON file sitting in the root of the repository is just easier to see and reason about.

Creating a file in the repository sounds simple enough — just create it and push. The problem is our GitHub branch rules: we don't allow direct pushes to main, everything has to go through a pull request. GitHub rules do let you specify people who can bypass this, but we wanted the process to be fully automated, with no human in the loop.

This is where the GitHub Application comes in. An application is another entity that can bypass branch rules. When you hear "application" you might assume it means writing some script or building something complex — it's actually much simpler than that. You just follow GitHub's instructions to set it up, then add the application to the bypass list in your ruleset.

One alternative is using GITHUB_TOKEN, but it comes with limitations — most notably, it cannot trigger other GitHub Actions workflows. The GitHub Application approach gives more freedom and fits our needs better.

To push changes without a human in the loop, the workflow authenticates as the GitHub Application, checks out the code, and configures Git:

- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.RHEO_APP_ID }}
private-key: ${{ secrets.RHEO_APP_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- name: Set up Git
run: |
git config user.name "rheo-app[bot]"
git config user.email "237771051+rheo-app[bot]@users.noreply.github.com"

This authentication pattern — generate a token, checkout, configure Git — is reused across all our automated stages.

Stage 2 — Create pull request (automatically)

This step is triggered automatically via a cron job every Thursday at 9am. It creates the release branch and opens a release pull request.

The automatic trigger also has a nice effect on the team. When the process is manual, there is always the temptation to negotiate with the release manager — "just wait a few minutes for my feature push." With an automatic trigger, that conversation doesn't happen. Once the release branch is created, any push to main goes into the next release, not the current one.

The workflow does the following:

  • Creates the release branch
  • Generates release notes using an LLM based on the commit messages
  • Bumps the version of each component using the config from Stage 1
  • Opens the release pull request
  • Deploys the application to the staging environment

Same as in Stage 1, the pull request is created by the GitHub Application. After the same token/checkout/git-config steps, the workflow opens the PR:

- name: Create Pull Request
run: |
gh pr create --title "$PR_TITLE" \
--body "$PR_BODY" \
--base main \
--head $BRANCH_NAME
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}

This step deploys all the components to the staging environment. Here is how it is implemented in the GitHub Action.

backend-deploy:
needs: release
uses: ./.github/workflows/backend.yml
with:
environment: stg
reason: "Release deployment to staging"
secrets: inherit

Our releases are triggered automatically via a cron job. The time is specified in UTC, but keep in mind there is always a delay between the scheduled time and the actual execution — up to 20 minutes. To minimize this, avoid "popular" times like full hours. Instead of scheduling your job at 09:00, use something like 08:55. The less traffic on GitHub's cron queue, the sooner your job actually runs.

on:
workflow_dispatch: # Allows manual triggering
schedule:
- cron: '50 7 * * 4'

We generate release notes automatically using an LLM based on the commit messages from the release branch. The quality of the generated notes depends directly on the quality of the commit messages. If your commit messages are vague — "fix", "update", "misc changes" — the generated notes will be just as vague. Good commit messages make a real difference here.

def generate_changelog_with_llm(api_key: str, component: str, version: str,
commits: List[Dict[str, str]], last_tag: Optional[str]) -> Optional[str]:
"""Generate changelog using Gemini API"""
if not api_key:
warn(f"No Gemini API key available. Skipping LLM changelog generation for {component}")
return None
commits_text = "\n".join([
f"- {commit['message']} ({commit['hash'][:8]}, {commit['author']})"
for commit in commits
])
prompt = f"""Generate a professional changelog entry for version {version}
of the {format_component_name(component)} component.
Based on these commits since {f'({last_tag})' if last_tag else 'the last release'}:
{commits_text}
# ... formatting instructions (Keep a Changelog format) ..."""
return call_gemini_api(api_key, prompt, max_tokens=2048)

Here you can see the release workflow in action.

Stage 3 — Testing and hotfixes

Once the application is deployed to staging, we run automated tests. We also test manually, with special attention to any newly introduced functionality. If a bug is found, a hotfix is created and merged directly into the release branch.

Stage 4 — Publish (manually)

When the release is ready, the release manager triggers the final action manually. It does the following:

  • Deploys to production
  • Creates a tag on the main repository
  • Creates the GitHub release
  • Publishes the SDK to PyPI
  • Removes the release config file from the repository

The SDK publish is a separate workflow triggered by the tag creation. This is another place where the GitHub Application matters — publishing to PyPI with GITHUB_TOKEN would not trigger other workflows, so the application is needed here as well. Also, direct calls to the PyPI publish workflow are blocked by PyPI itself, so tag-based triggering is the only clean way to handle it.

Summary and future outlook

Automating our release process removed a lot of friction. Releases are now repeatable, faster, and less dependent on any single person knowing the steps. New team members don't need to be walked through a manual procedure — the process just runs.

The cron-based trigger also brought an unexpected benefit: it introduced a natural rhythm to our releases and removed the "just wait for my push" conversations entirely.

There is still room to improve — better test coverage in staging, smarter hotfix detection, and tighter feedback loops. But the foundation is solid, and it already made a real difference in how we work.

Interested in Rhesis? Check out our documentation or GitHub repository.

FAQ

Why use a GitHub App instead of GITHUB_TOKEN? GITHUB_TOKEN has significant limitations for automation workflows. Most importantly, it cannot trigger other GitHub Actions workflows, which breaks the chain of automation we need for our release process. GitHub Apps also provide fine-grained permissions and can bypass branch protection rules when properly configured, while GITHUB_TOKEN is limited to the current repository's scope. For complex release workflows that need to trigger multiple actions and work across different parts of your repository, a GitHub App is essential.

What happens if the automated cron job fails? GitHub Actions cron jobs can occasionally fail due to service issues or resource constraints. That's why we also include workflow_dispatch in our trigger configuration, allowing manual triggering as a fallback.

How do you ensure the quality of automatically generated release notes? Good commit messages make good release notes. We use conventional commits (feat:, fix:, etc.) and write descriptive messages that explain why, not just what. The LLM does the formatting, but if the output looks off, we can always edit it before publishing.

Can this workflow be adapted for different deployment environments? Yes. We use the same deployment workflows for staging and production, just with different environment parameters (environment: stg vs environment: prod).