Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions .github/workflows/crates-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ name: Crates Version Bump

on:
workflow_dispatch:
inputs:
pre-id:
description: 'Prerelease identifier for prerelease versions'
required: false
default: 'alpha'
type: choice
options:
- beta
- rc
force:
description: 'Force version bump even if no changes detected'
required: false
default: false
type: boolean

jobs:
bump-version:
Expand Down Expand Up @@ -43,17 +29,19 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Run version bump
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
BRANCH="${GITHUB_REF_NAME}"
PRE_ID="${{ inputs.pre-id }}"
FORCE="${{ inputs.force }}"
REPO_ROOT="$(git rev-parse --show-toplevel)"

echo "Running on branch: $BRANCH"
echo "Prerelease identifier: $PRE_ID"

$REPO_ROOT/scripts/bump-version.sh

echo "publishing on crates.io"
cargo release publish --workspace --execute

git push origin "$BRANCH"
git push origin --tags

Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/homebrew-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Update Homebrew Formula

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to update to (e.g., 1.0.1)'
required: true
type: string

jobs:
update-homebrew:
name: Update Homebrew Formula
runs-on: macos-latest
if: contains(github.event.release.tag_name, 'quickmark-cli@') || github.event_name == 'workflow_dispatch'

steps:
- name: Extract version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
# Extract version from tag (quickmark-cli@1.0.0 -> 1.0.0)
version="${{ github.event.release.tag_name }}"
version="${version#quickmark-cli@}"
echo "version=$version" >> $GITHUB_OUTPUT
fi

- name: Setup Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Update Homebrew formula using bump-formula-pr
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Use brew bump-formula-pr to automatically update the formula
brew bump-formula-pr \
--tap=ekropotin/homebrew-formula \
--version="${{ steps.version.outputs.version }}" \
--message="chore(brew): quickmark-cli ${{ steps.version.outputs.version }}

Updates quickmark-cli to version ${{ steps.version.outputs.version }}.

This PR was automatically created by the quickmark release workflow." \
--no-browse \
--no-fork \
quickmark-cli || {
echo "Failed to create PR. Possible reasons:"
echo "1. The version is already up to date"
echo "2. The release assets are not yet available"
echo "3. There was a network issue"
echo "4. The formula doesn't exist or has issues"
exit 1
}
6 changes: 3 additions & 3 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
Expand All @@ -34,9 +37,6 @@ jobs:
with:
tool: cargo-release,git-cliff

- name: Publish quickmark-cli to crates.io
run: cargo publish -p quickmark-cli --token ${{ secrets.CRATES_IO_TOKEN }}

- name: Generate changelog
id: changelog
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
Expand All @@ -34,9 +37,6 @@ jobs:
with:
tool: cargo-release,git-cliff

- name: Publish quickmark-core to crates.io
run: cargo publish -p quickmark-core --token ${{ secrets.CRATES_IO_TOKEN }}

- name: Generate changelog
id: changelog
run: |
Expand Down
31 changes: 4 additions & 27 deletions .github/workflows/release-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -78,35 +81,9 @@ jobs:
path: ${{ steps.binary-archive.outputs.archive_name }}
if-no-files-found: error

publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/quickmark-server@')

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Publish quickmark-server to crates.io
run: cargo publish -p quickmark-server --token ${{ secrets.CRATES_IO_TOKEN }}

release:
name: Create Release
needs: [build, publish]
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/quickmark-server@')
permissions:
Expand Down
3 changes: 0 additions & 3 deletions release.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# pre-release-commit-message = "chore: Release {{crate_name}} version {{version}}"
tag-name = "{{crate_name}}@{{version}}"
verify = false
push = false
publish = false
consolidate-commits = true