Prepare Release #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Prepare Release | |
| concurrency: | |
| group: prepare-release-${{ github.ref }} | |
| cancel-in-progress: false | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: "Semantic version bump" | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| default: patch | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| prepare-release: | |
| name: Prepare Release | |
| runs-on: ubuntu-latest | |
| env: | |
| CARGO_TERM_COLOR: always | |
| steps: | |
| - name: Checkout (Full History) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-edit | |
| run: cargo install cargo-edit --locked | |
| - name: Bump Workspace Versions | |
| run: | | |
| cargo set-version --workspace --bump "${{ inputs.bump }}" | |
| - name: Read New Version | |
| id: ver | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| NEXT_VERSION=$(grep -m1 '^version = "' etl/Cargo.toml | sed -E 's/version = "([0-9]+\.[0-9]+\.[0-9]+)"/\1/') | |
| if [[ -z "${NEXT_VERSION}" ]]; then | |
| echo "Failed to parse bumped version from etl/Cargo.toml" >&2 | |
| exit 1 | |
| fi | |
| echo "next=${NEXT_VERSION}" >> "$GITHUB_OUTPUT" | |
| echo "Next version: ${NEXT_VERSION}" | |
| - name: Install git-cliff | |
| run: cargo install git-cliff --locked | |
| - name: Generate CHANGELOG.md | |
| env: | |
| NEXT_VERSION: ${{ steps.ver.outputs.next }} | |
| run: | | |
| # Generate changelog with the new tag, containing only unreleased changes (difference from last tag) | |
| # and prepend it to the existing changelog. | |
| git cliff --config cliff.toml --tag "v${NEXT_VERSION}" --unreleased --prepend CHANGELOG.md | |
| - name: Create Release Pull Request | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: "chore(release): v${{ steps.ver.outputs.next }}" | |
| title: "chore(release): v${{ steps.ver.outputs.next }}" | |
| body: | | |
| This PR prepares release v${{ steps.ver.outputs.next }}. | |
| - Bumps workspace versions. | |
| - Updates CHANGELOG.md with unreleased changes. | |
| Merging this PR into `main` will trigger the release workflow which tags the commit, publishes Docker images, and creates the GitHub Release. | |
| branch: release/v${{ steps.ver.outputs.next }} | |
| base: main | |
| labels: | | |
| release | |
| automated | |
| delete-branch: true |