11name : ' Bump Versions'
2- description : ' This action bumps versions of Cargo.toml and _version.py file, matching release tag'
2+ description : ' This action bumps versions of Cargo.toml file, matching release tag'
33
44runs :
55 using : ' composite'
66 steps :
77 - uses : actions/checkout@v4
8+ # To fetch all the tags and history
9+ with :
10+ fetch-depth : 0
11+
12+ # - name: Fetch all tags explicitly
13+ # run: git fetch --tags
14+ # shell: bash
15+
16+ # - name: Get all tags
17+ # run: git tag
18+ # shell: bash
19+
20+ # - name: Get latest
21+ # run: git describe --tags --abbrev=0 2> /dev/null
22+ # shell: bash
23+ #
24+ # - name: Get the exact Git tag or latest tag + dev
25+ # run: |
26+ # tag=$(git describe --exact-match --tags 2>&1) || {
27+ # echo "Error: No exact match tag found."
28+ # tag=""
29+ # }
30+ # # If no exact match tag found, get the latest tag or set default
31+ # if [ -z "$tag" ]; then
32+ # version="0.0.0"
33+ # else
34+ # version="$tag"
35+ # fi
36+ # echo "Version: $version"
37+ # echo "version=$version" >> $GITHUB_ENV
38+ # shell: bash
839
940 - name : Bump Cargo version
10- # python ./cargo_version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
1141 run : |
12- python .github/actions/bump_version/cargo_version_bumper.py --target Cargo.toml "0.0.1"
42+ # python .github/actions/bump_version/cargo_version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
43+ python .github/actions/bump_version/cargo_version_bumper.py --target Cargo.toml "0.2.3"
1344 shell : bash
1445
15- # - name: Check Cargo.toml version matches Release tag
16- # run: |
17- # CARGO_VERSION=$(grep '^version =' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
18- # if [ "${GITHUB_REF#refs/tags/}" != "$CARGO_VERSION" ]; then
19- # echo "Version mismatch: Cargo.toml ($CARGO_VERSION) doesn't match Release tag (${GITHUB_REF#refs/tags/})"
20- # exit 1
21- # fi
46+ # - name: Check Cargo.toml version matches Release tag
47+ # run: |
48+ # CARGO_VERSION=$(grep '^version =' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
49+ # if [ "${GITHUB_REF#refs/tags/}" != "$CARGO_VERSION" ]; then
50+ # echo "Version mismatch: Cargo.toml ($CARGO_VERSION) doesn't match Release tag (${GITHUB_REF#refs/tags/})"
51+ # exit 1
52+ # fi
0 commit comments