Skip to content

Commit fb0fcc5

Browse files
committed
Ensure release process works end-to-end
1 parent 086eb10 commit fb0fcc5

4 files changed

Lines changed: 29 additions & 27 deletions

File tree

.github/workflows/auto-tag.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ jobs:
3636
git tag -a "v${{ steps.version.outputs.version }}" -m "Release version ${{ steps.version.outputs.version }}"
3737
git push origin "v${{ steps.version.outputs.version }}"
3838
39+
- name: Trigger publish workflow
40+
run: gh workflow run publish.yml -f version=${{ steps.version.outputs.version }}
41+
env:
42+
GH_TOKEN: ${{ github.token }}
43+

.github/workflows/prepare-release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77
inputs:
88
version:
9-
description: 'Version to release (e.g., 0.10.0)'
9+
description: 'Version to release (e.g. 0.10.0)'
1010
required: true
1111
type: string
1212

@@ -33,12 +33,15 @@ jobs:
3333
exit 1
3434
fi
3535
36-
- name: Update versions in Cargo.toml files
36+
- name: Install cargo-release
37+
run: cargo install cargo-release
38+
39+
- name: Bump versions
3740
run: |
38-
VERSION="${{ inputs.version }}"
39-
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
41+
cargo release version ${{ inputs.version }} --workspace --execute --no-confirm --allow-branch main
4042
4143
- name: Check compatibility
44+
continue-on-error: true
4245
uses: obi1kenobi/cargo-semver-checks-action@v2
4346

4447
- name: Run tests

.github/workflows/publish.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
tags:
66
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to publish (e.g. 0.16.0)'
11+
required: true
12+
type: string
713

814
permissions:
915
contents: write
@@ -25,34 +31,22 @@ jobs:
2531
- name: Extract version from tag
2632
id: version
2733
run: |
28-
VERSION=${GITHUB_REF#refs/tags/v}
34+
if [ -n "${{ inputs.version }}" ]; then
35+
VERSION="${{ inputs.version }}"
36+
else
37+
VERSION=${GITHUB_REF#refs/tags/v}
38+
fi
2939
echo "version=$VERSION" >> $GITHUB_OUTPUT
3040
echo "Publishing version: $VERSION"
3141
32-
- name: Publish derive crate
33-
env:
34-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35-
run: cargo publish -p revision-derive
42+
- name: Install cargo-release
43+
run: cargo install cargo-release
3644

37-
- name: Wait for revision-derive to be available
38-
run: |
39-
VERSION="${{ steps.version.outputs.version }}"
40-
echo "Waiting for revision-derive $VERSION on crates.io..."
41-
for i in {1..60}; do
42-
if cargo search revision-derive --limit 1 | grep -q "revision-derive = \"$VERSION\""; then
43-
echo "Found revision-derive $VERSION"
44-
exit 0
45-
fi
46-
echo "Retry $i/60..."
47-
sleep 5
48-
done
49-
echo "Timed out waiting for crates.io"
50-
exit 1
51-
52-
- name: Publish main crate
45+
- name: Publish to crates.io
5346
env:
5447
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
55-
run: cargo publish -p revision
48+
run: |
49+
cargo release publish --workspace --execute --no-confirm --no-tag --no-push --allow-branch HEAD
5650
5751
- name: Create GitHub Release
5852
uses: softprops/action-gh-release@v1

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ default = ["specialised"]
3333
specialised = []
3434

3535
[dependencies]
36-
revision-derive = { path = "revision-derive" }
36+
revision-derive = { version = "0.16.0", path = "revision-derive" }
3737
bytes = { version = "1.11.0", optional = true }
3838
chrono = { version = "0.4.42", features = ["serde"], optional = true }
3939
geo = { version = "0.31.0", features = ["use-serde"], optional = true }

0 commit comments

Comments
 (0)