Skip to content

Automatically creates release pull-request which when merged will trigger a release

License

Notifications You must be signed in to change notification settings

woodpecker-ci/plugin-ready-release-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

240d308 Β· Mar 31, 2025
Mar 29, 2025
Jan 20, 2025
Nov 28, 2024
Nov 28, 2024
Nov 5, 2024
Nov 9, 2023
Nov 9, 2023
Jan 25, 2025
Jul 16, 2024
Jul 16, 2024
Sep 26, 2024
Mar 25, 2025
Oct 22, 2024
Nov 28, 2024
Nov 6, 2024
Nov 9, 2023
Jan 20, 2025
Jan 20, 2025
Nov 4, 2024
Nov 4, 2024
Mar 9, 2025
Mar 31, 2025
Jul 16, 2024
Oct 28, 2023
Nov 28, 2024
Jul 16, 2024

Repository files navigation

Ready release go πŸš€

This plugin can be executed on every push to your release branch (e.g. default branch) and will create a new release pull-request with an updated changelog as preparation for the next release. After merging the "release"-pull-request, a new release / tag will be created for you.

Usage

Woodpecker CI

Create a new workflow like .woodpecker/release-helper.yml:

when:
  event: push
  branch: ${CI_REPO_DEFAULT_BRANCH}

steps:
  release-helper:
    image: woodpeckerci/plugin-ready-release-go:<version>
    settings:
      git_email: my-email@example.org
      forge_token:
        from_secret: GITHUB_TOKEN
      # release_branch: 'custom-release-branch' # default: main
      # pull_request_branch_prefix: 'next-release/'
      # debug: true

Configuring PR label categorization

The plugin automatically categorizes every pull-request based on it's labels. The default labels are defined here. To change it, create a release-config.ts at the repository root and overwrite the changeTypes property:

export default {
  changeTypes: [
    {
      title: 'πŸ’₯ Breaking changes',
      labels: ['breaking'],
      bump: 'major',
      weight: 3,
    },
    {
      title: 'πŸ”’ Security',
      labels: ['security'],
      bump: 'patch',
      weight: 2,
    },
    {
      title: '✨ Features',
      labels: ['feature', 'feature πŸš€οΈ'],
      bump: 'minor',
      weight: 1,
    },
    {
      title: 'πŸ“ˆ Enhancement',
      labels: ['enhancement', 'refactor', 'enhancement πŸ‘†οΈ'],
      bump: 'minor',
    },
    {
      title: 'πŸ› Bug Fixes',
      labels: ['bug', 'bug πŸ›οΈ'],
      bump: 'patch',
    },
    {
      title: 'πŸ“š Documentation',
      labels: ['docs', 'documentation', 'documentation πŸ“–οΈ'],
      bump: 'patch',
    },
    {
      title: 'πŸ“¦οΈ Dependency',
      labels: ['dependency', 'dependencies'],
      bump: 'patch',
      weight: -1,
    },
    {
      title: 'Misc',
      labels: ['misc', 'chore 🧰'],
      bump: 'patch',
      default: true,
      weight: -2,
    },
  ],
};

Workflow

  1. Setup ready-release-go on your repository by adding a config file and a workflow file
  2. On every push to your default branch a pull-request will be created and updated
  3. You can review the pull-request and merge it when you are ready
  4. The plugin will create a new release

Internal workflow

  • get latest release => tag
  • get all commits since commit of last tag
  • get all prs of those commits (if they have a pr associated)
  • get all labels of those prs
  • get next version based on labels of PRs
  • get changelog based on labels of PRs

Roadmap

  • Automatically create release pull-request
  • Automatically update release pull-request
  • Create a release / tag after "release"-pull-request got merged
  • Handle -rc versions
  • Support first release (no previous tags)
  • Support defining next version manually (can be done by changing the version on the release pull-request title / commit message)
  • Support more forges:
    • Github
    • Gitea
    • Forgejo (via gitea api client)
    • Gitlab
    • Bitbucket

Credits

This plugin is inspired by release-please, release-drafter and shipjs. Thanks for the great work! Compared to the mentioned tools ready-release-go is not requiring a npm package and can be used with any kind of programming language, changelog tool and commit style.