From 72345a7c500430c46b8aa158b29c471f648d3dbb Mon Sep 17 00:00:00 2001 From: Jermiah Joseph Date: Tue, 29 Oct 2024 14:02:28 -0400 Subject: [PATCH] feat: enhance release workflow to publish version of docs using mike after PR release fix: update docs to explain mike --- .github/workflows/release-please.yaml | 21 ++++++++++++++++++++- docs/contributing/release_deployment.md | 23 ++++++++++++++--------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 657276d5..420f6c02 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -12,8 +12,27 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: GoogleCloudPlatform/release-please-action@v4 id: release with: release-type: simple + + - uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + with: + fetch-depth: 0 + + - name: Install Pixi + if: ${{ steps.release.outputs.release_created }} + uses: prefix-dev/setup-pixi@v0.8.1 + with: + pixi-version: v0.34.0 + cache: true + locked: false + + - name: Deploy Documentation Using Mike and Released Version + if: ${{ steps.release.outputs.release_created }} + run: | + VERSION=$(echo ${{ steps.release.outputs.tag_name }} | sed 's/v//') + echo "Deploying version $VERSION" + pixi run mike deploy --push --update-aliases $VERSION latest diff --git a/docs/contributing/release_deployment.md b/docs/contributing/release_deployment.md index 7ce8d12d..c5ad37b6 100644 --- a/docs/contributing/release_deployment.md +++ b/docs/contributing/release_deployment.md @@ -34,11 +34,12 @@ The automated workflow includes the following steps: Once the `gh-pages` branch is updated, GitHub Pages will automatically publish the latest version of the website. -## Releases +## Releases and Versioned Documentation -Even though this project primarily uses MkDocs, we leverage -[release-please](https://github.com/googleapis/release-please) to automate the -release process, making it easier to maintain version control and changelogs. +We leverage both [release-please](https://github.com/googleapis/release-please) +and `mike` to automate the release process and manage versioned documentation, +making it easier to maintain version control, changelogs, and multiple +documentation versions. ### How It Works @@ -49,11 +50,11 @@ process. You can view the release automation action at [this link](https://github.com/bhklab/handbook/actions/workflows/release-please.yaml). -Key benefits of using `release-please` include: +Key aspects of this combined approach include: -- **Automated Release Creation**: The tool automatically generates a release - with changelogs and updates the version number based on the changes merged - into `main`. +- **Automated Release Creation with release-please**: The tool automatically + generates a release with changelogs and updates the version number based + on the changes merged into `main`. - **Dynamic Pull Request Updates**: If additional changes are pushed to the `main` branch after a pull request is created, the release PR will update to include those changes, ensuring that the release captures all intended @@ -61,6 +62,10 @@ Key benefits of using `release-please` include: - **Controlled Release Process**: Maintainers can merge changes into the release PR only when they are ready to publish a new version, giving them full control over the timing of each release. +- **Versioned Documentation with mike**: Once a new release is prepared, + `mike` is used to manage and deploy versioned documentation. This allows us + to provide a separate set of documentation for each release, maintaining + historical versions accessible on the website. -This automated approach ensures consistency and reduces the manual effort +This automated approach ensures consistency, reduces manual effort, and allows users to access documentation relevant to any specific version of the project. required to manage releases.