Skip to content

Commit 3ba646b

Browse files
authored
Merge pull request #11 from rursache/fix/version-sync
Fix version reporting and auto-sync on release
2 parents 91b1437 + d335f30 commit 3ba646b

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ jobs:
4141
if: matrix.cross
4242
run: cargo install cross --git https://github.com/cross-rs/cross
4343

44+
- name: Set version from tag
45+
run: |
46+
VERSION="${GITHUB_REF_NAME#v}"
47+
sed -i'' -e "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
48+
4449
- name: Build
4550
run: |
4651
if [ "${{ matrix.cross }}" = "true" ]; then
@@ -86,13 +91,23 @@ jobs:
8691
with:
8792
ref: main
8893

94+
- uses: dtolnay/rust-toolchain@stable
95+
8996
- name: Update Homebrew formula
9097
run: scripts/update-formula.sh ${{ github.ref_name }}
9198

92-
- name: Commit and push updated formula
99+
- name: Sync Cargo.toml version
100+
run: |
101+
VERSION="${GITHUB_REF_NAME#v}"
102+
sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
103+
cargo update --workspace
104+
105+
- name: Commit and push
93106
run: |
94107
git config user.name "github-actions[bot]"
95108
git config user.email "github-actions[bot]@users.noreply.github.com"
96-
git add Formula/polymarket.rb
97-
git commit -m "brew: update formula for ${{ github.ref_name }}"
98-
git push
109+
git add Formula/polymarket.rb Cargo.toml Cargo.lock
110+
git diff --cached --quiet && echo "Nothing to commit" || {
111+
git commit -m "release: update formula and version to ${{ github.ref_name }}"
112+
git push
113+
}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polymarket-cli"
3-
version = "0.1.0"
3+
version = "0.1.4"
44
edition = "2024"
55
rust-version = "1.88.0"
66
description = "CLI for Polymarket — browse markets, trade, and manage positions"

0 commit comments

Comments
 (0)