Skip to content

Commit

Permalink
Update all Cargo.toml files when tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ecbr0wn committed Feb 25, 2024
1 parent cd4f5b6 commit 73fa55b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ jobs:
if grep -P '^v[0-9]+\.[0-9]+\.[0-9]+' <<< "${input_version}"; then
echo "tag=${input_version}" >> $GITHUB_ENV
echo "cargo_version=version = \"${input_version:1}\"" >> $GITHUB_ENV
echo "snapcraft_dep_version=snapcraft = { path = "../snapcraft", version = \"${input_version:1}\"}" >> $GITHUB_ENV
elif grep -P '^[0-9]+\.[0-9]+\.[0-9]+' <<< "${input_version}"; then
echo "tag=v${input_version}" >> $GITHUB_ENV
echo "cargo_version=version = \"${input_version}\"" >> $GITHUB_ENV
echo "snapcraft_dep_version=snapcraft = { path = "../snapcraft", version = \"${input_version}\"}" >> $GITHUB_ENV
else
false
fi
Expand All @@ -47,7 +49,9 @@ jobs:
- name: Replace the version number in the Cargo.toml files
run: |
sed -i 's/^version = .*/${{ env.cargo_version }}/g' Cargo.toml
sed -i 's/^version = .*/${{ env.cargo_version }}/g' snapcraft/Cargo.toml
sed -i 's/^version = .*/${{ env.cargo_version }}/g' snapcraft-rust-example/Cargo.toml
sed -i 's/^snapcraft = { path = "../snapcraft", version = .*/${{ env.snapcraft_dep_version }}/g' snapcraft-rust-example/Cargo.toml
- name: Add, push, tag, push
run: |
Expand Down
2 changes: 1 addition & 1 deletion snapcraft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ categories = ["filesystem", "os", "api-bindings"]
[dependencies]

[dev-dependencies]
serial_test = "2"
serial_test = "3"

0 comments on commit 73fa55b

Please sign in to comment.