discourse/.github/workflows/release-handler.yml
David Taylor e5fb8b59f2
DEV: Introduce new versioning system (#35180)
Implements date-based versioning, based on the RFC at
https://meta.discourse.org/t/383536

Manual version-bump tasks are removed, and replaced with new `release:*`
rake tasks. These are run in GitHub actions. Release process will work
something like:

1. Trigger `release-prepare-latest-bump` via workflow_dispatch. This
will create a PR which bumps the in-development version to the next
`-latest`

2. Merge that PR

3. `release-handler` will be triggered automatically, tag the commit
with `v0000.00.0-latest`, and cut a `release/xxxx.xx` branch from the
previous commit

4. `release-prepare-bump` will be triggered automatically, and create a
PR which bumps the version on `release/xxxx.xx` branch to remove the
`-latest` suffix

5. Merge that PR

6. `release-handler` will be triggered automatically, and will tag the
commit with `v0000.00.0`

In future, we will add handling for ESR, and new workflows for security
fixes.
2025-11-25 14:01:46 +00:00

49 lines
1.2 KiB
YAML
Vendored

name: Release - create tags & branches
on:
workflow_dispatch:
inputs:
sha:
description: "The commit SHA to prepare the release for"
required: false
type: string
push:
branches:
- main
- release/*
paths:
- "lib/version.rb"
permissions:
contents: write
pull-requests: write
actions: write
jobs:
build:
name: run
runs-on: ubuntu-latest
container: discourse/discourse_test:slim
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
filter: tree:0
fetch-depth: 0
- uses: ./.github/actions/setup-release-environment
- name: Maybe cut branch
id: maybe-cut-branch
if: github.ref == 'refs/heads/main'
run: bin/rake release:maybe_cut_branch[${{ inputs.sha || github.sha }}]
- name: Maybe trigger prepare next version
if: steps.maybe-cut-branch.outputs.new_branch_name
run: gh workflow run release-prepare-bump.yml -f branch="${{ steps.maybe-cut-branch.outputs.new_branch_name }}"
env:
GH_TOKEN: ${{ github.token }}
- name: Maybe tag release
run: bin/rake release:maybe_tag_release[${{ inputs.sha || github.sha }}]