Skip to content

Migrate release automation to use Release Please for version management #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tiberriver256 opened this issue Apr 2, 2025 · 0 comments · Fixed by #114
Closed

Migrate release automation to use Release Please for version management #113

Tiberriver256 opened this issue Apr 2, 2025 · 0 comments · Fixed by #114
Labels

Comments

@Tiberriver256
Copy link
Owner

Tiberriver256 commented Apr 2, 2025

Background

Our release automation workflow (.github/workflows/release.yml) currently relies on standard-version for changelog generation and version bumping. While this approach works, it requires manual triggering of releases and doesn't fully automate the process based on commit standards.

After reviewing options, we've identified that Google's release-please library would be a better fit than Commitizen for our needs, especially since standard-version recommends release-please as a more automated approach.

Current Approach

Our current workflow:

  1. Requires manual triggering via workflow_dispatch
  2. Uses standard-version to determine version bump based on commits
  3. Extract changelog content and push changes/tags
  4. Builds and publishes to npm
  5. Creates a GitHub release

Proposed Changes

We propose migrating to the release-please pattern which:

  1. Fully automates version determination based on Conventional Commits
  2. Generates a standardized changelog
  3. Creates GitHub releases with proper notes
  4. Can trigger our npm publish workflow upon release

Implementation Plan

  1. Add release-please workflow: Create a new workflow file that handles version bumping and release PR creation
  2. Update dependencies: Add required dependencies for release-please
  3. Modify existing workflow: Adapt existing release workflow to be triggered by release-please releases

Example release-please.yml workflow

name: Release Please

on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: googleapis/release-please-action@v4
        id: release
        with:
          # Using Node.js release type as we have a package.json
          release-type: node
          # This is a personal access token for creating GitHub releases
          token: ${{ secrets.RELEASE_PAT }}

      # The following steps only run if a new release is created
      - name: Checkout code
        if: ${{ steps.release.outputs.release_created }}
        uses: actions/checkout@v3
        with:
          ref: ${{ steps.release.outputs.tag_name }}

      - name: Setup Node.js
        if: ${{ steps.release.outputs.release_created }}
        uses: actions/setup-node@v3
        with:
          node-version: 'lts/*'
          registry-url: 'https://registry.npmjs.org/'

      - name: Install Dependencies
        if: ${{ steps.release.outputs.release_created }}
        run: npm ci

      - name: Build package
        if: ${{ steps.release.outputs.release_created }}
        run: npm run build

      - name: Publish to npm
        if: ${{ steps.release.outputs.release_created }}
        run: npm publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Benefits

  1. Automation: Eliminates manual release triggering - releases happen automatically based on commit history
  2. Standardization: Enforces using Conventional Commits which improves git history and changelog quality
  3. Clarity: Provides clear visibility of pending changes through Release PRs
  4. Reduced Manual Work: Automates version bumping and changelog generation

Next Steps

  1. Review and approve this approach
  2. Implement the release-please.yml workflow
  3. Test with a minor/patch release
  4. Update documentation to reflect new release process

References

@Tiberriver256 Tiberriver256 changed the title Migrate release automation to use Commitizen for version management Migrate release automation to use Release Please for version management Apr 2, 2025
Tiberriver256 added a commit that referenced this issue Apr 2, 2025
standard-version is deprecated. Release Please is the recommended tool as a replacement.

closes #113
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 a pull request may close this issue.

1 participant