Skip to content

docs: add autogenerated documentation site #148

docs: add autogenerated documentation site

docs: add autogenerated documentation site #148

Workflow file for this run

on:
push:
branches: [main]
name: Open a PR to bump the version
jobs:
open_pr:
strategy:
matrix:
component: ["server", "client"]
name: Open PR
runs-on: ubuntu-24.04
permissions:
pull-requests: write
contents: write
steps:
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: swatinem/rust-cache@v2
- run: cargo install git-cliff@^2.6 cargo-edit@^0.12
- name: determine version
run: |
echo "COMPONENT=${{ matrix.component }}" | tee -a "$GITHUB_ENV"
echo "CURRENT_VERSION=$( git tag | grep "${{ matrix.component }}" | tail -1 )" | tee -a "$GITHUB_ENV"
mm_component="mm-${{ matrix.component }}"
echo "MM_COMPONENT=$mm_component" | tee -a "$GITHUB_ENV"
version=$( git cliff -c .github/workflows/cliff.toml \
--bumped-version \
--include-path "$MM_COMPONENT*/**/*" \
--tag-pattern "${{ matrix.component }}" )
echo "BUMPED_VERSION=$version" | tee -a "$GITHUB_ENV"
echo "BUMPED_VERSION_SHORT=$( echo $version | sed -E 's/^[a-z]+-v(.*)/\1/' )" | tee -a "$GITHUB_ENV"
- name: replace version in files
if: ${{ env.BUMPED_VERSION != env.CURRENT_VERSION }}
run: |
git ls-files | grep -v CHANGELOG |\
xargs sed -i -E "s/mm$COMPONENT-v[0-9]+\.[0-9]+\.[0-9]+/$BUMPED_VERSION/g"
- name: replace version in Cargo.toml
if: ${{ env.BUMPED_VERSION != env.CURRENT_VERSION }}
run: (cd $MM_COMPONENT && cargo set-version --offline $BUMPED_VERSION_SHORT)
- name: cargo update
if: ${{ env.BUMPED_VERSION != env.CURRENT_VERSION }}
run: (cd $MM_COMPONENT && cargo update $MM_COMPONENT)
- name: update BUSL change date
if: ${{ env.BUMPED_VERSION != env.CURRENT_VERSION && matrix.component == 'server' }}
run: |
change_date=$(date -d "4 years hence" +%Y-%m-01) # Round down to the 1st of the month
sed -i -E "/Change/s/[0-9]{4}-[0-9]{2}-[0-9]{2}/$change_date/" LICENSES/BUSL-1.1.txt
- name: update CHANGELOG.md
if: ${{ env.BUMPED_VERSION != env.CURRENT_VERSION }}
run: |
git cliff -c .github/workflows/cliff.toml \
--include-path "$MM_COMPONENT*/**/*" \
--tag-pattern "$COMPONENT" \
-t "$BUMPED_VERSION" -u \
-p CHANGELOG.md
- name: generate PR body
if: ${{ env.BUMPED_VERSION != env.CURRENT_VERSION }}
run: |
git cliff -c .github/workflows/cliff.toml \
--include-path "$MM_COMPONENT*/**/*" \
--tag-pattern "$COMPONENT" \
-t "$BUMPED_VERSION" -u > "$RUNNER_TEMP/pr-body.txt"
- name: open PR
if: ${{ env.BUMPED_VERSION != env.CURRENT_VERSION }}
id: cpr
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
with:
draft: true
branch: "auto-bump-${{ matrix.component }}"
title: ":robot: bump mm${{ matrix.component }} to ${{ env.BUMPED_VERSION }}"
commit-message: "chore: bump mm${{ matrix.component }} to ${{ env.BUMPED_VERSION }}"
body-path: "${{ runner.temp }}/pr-body.txt"