mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-09-25 06:55:37 +00:00
Until now only the clippy CI job and the Dockerfile named a Rust version (kept in sync by hand), while every other CI job, the release binaries and the docs build ran on whatever `stable` happened to be that day. Rust 1.98.0 landing on 2026-08-20 broke `build-binaries` overnight because of that (#5935). `rust-toolchain.toml` pins 1.96.0 with the `minimal` profile plus clippy, and every `rustup toolchain install stable ...` in CI becomes a bare `rustup toolchain install`, which reads the file. Starting at 1.96.0 (the version clippy is already clean against) keeps this change free of lint churn; catching up to 1.98.0 is a follow-up. rustfmt stays on nightly because `.rustfmt.toml` uses nightly-only options, so that job now invokes `cargo +nightly fmt` explicitly instead of setting a rustup directory override, which would silently take precedence over the toolchain file. The file does not list the linux cross-compilation targets on purpose: that would make every developer and CI job download `rust-std` they never use. The two consumers that cross-compile add the targets themselves.
110 lines
3.1 KiB
YAML
110 lines
3.1 KiB
YAML
# Copyright 2025, 2026 Element Creations Ltd.
|
|
# 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install Rust toolchain
|
|
run: rustup toolchain install
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v6.0.9
|
|
|
|
- name: Install Node
|
|
uses: actions/setup-node@v7.0.0
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: "pnpm"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- 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=$(pnpm exec semver -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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
|
|
with:
|
|
sparse-checkout: |
|
|
.github/scripts
|
|
persist-credentials: false
|
|
|
|
- name: Update the release branch
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.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 });
|