Files
matrix-authentication-service/.github/workflows/release-bump.yaml
dependabot[bot] 712e94595d build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 13:12:43 +00:00

94 lines
2.6 KiB
YAML

# Copyright 2025 New Vector Ltd.
#
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
# Please see LICENSE files in the repository root for full details.
name: Bump the version on a release branch
on:
workflow_dispatch:
inputs:
rc:
description: "Is it a release candidate?"
type: boolean
default: false
merge-back:
description: "Should we merge back the release branch to main?"
type: boolean
default: true
jobs:
compute-version:
name: Compute the next version
runs-on: ubuntu-24.04
permissions:
contents: read
outputs:
version: ${{ steps.next.outputs.version }}
steps:
- name: Fail the workflow if not on a release branch
if: ${{ !startsWith(github.ref_name, 'release/v') }}
run: exit 1
- name: Checkout the code
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Extract the current version
id: current
run: echo "version=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "mas-cli") | .version')" >> "$GITHUB_OUTPUT"
- name: Compute the new minor RC
id: next
env:
BUMP: ${{ inputs.rc && 'prerelease' || 'patch' }}
VERSION: ${{ steps.current.outputs.version }}
run: echo "version=$(npx --yes semver@7.5.4 -i "$BUMP" --preid rc "$VERSION")" >> "$GITHUB_OUTPUT"
tag:
uses: ./.github/workflows/tag.yaml
needs: [compute-version]
with:
version: ${{ needs.compute-version.outputs.version }}
secrets:
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
merge-back:
uses: ./.github/workflows/merge-back.yaml
needs: [tag]
if: inputs.merge-back
with:
sha: ${{ needs.tag.outputs.sha }}
secrets:
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
update-branch:
name: Update the release branch
runs-on: ubuntu-24.04
permissions:
pull-requests: write
needs: [tag, compute-version]
steps:
- name: Checkout the code
uses: actions/checkout@v6
with:
sparse-checkout: |
.github/scripts
- name: Update the release branch
uses: actions/github-script@v8.0.0
env:
BRANCH: "${{ github.ref_name }}"
SHA: ${{ needs.tag.outputs.sha }}
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
script: |
const script = require('./.github/scripts/update-release-branch.cjs');
await script({ core, github, context });