Skip to content

Commit

Permalink
ci: use rust version of gib
Browse files Browse the repository at this point in the history
  • Loading branch information
Coenraad Human committed May 15, 2024
1 parent 221b958 commit 0addbc3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/update-version-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,33 @@ jobs:
- name: Calculate Version
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/coenraadhuman/gib:0.6.5
options: -v ${{ github.workspace }}:/app
image: ghcr.io/coenraadhuman/gib:1.0.2
shell: bash
options: --user 1001 -v ${{ github.workspace }}:/app
run : |
sed -i '0, /version/s/version.*/version = "'$(gib version -pa /app)'"/' /app/Cargo.toml
echo "====================="
echo "Files mounted on /app"
echo "====================="
ls -la /app
echo "======="
echo "Run gib"
echo "======="
calculated_version=$(gib version -p /app)
echo "Calculated version: $calculated_version"
echo "============================="
echo "Replace version in Cargo.toml"
echo "============================="
semantic_version_regex='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
if [[ $calculated_version =~ $semantic_version_regex ]]; then
sed -i '0, /version/s/version.*/version = "'$(echo $calculated_version)'"/' /app/Cargo.toml
else
echo "Invalid version, can't update version in Cargo.toml"
exit 1
fi
- name: Generate Changelog
uses: addnab/docker-run-action@v3
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.

- Build and test
- Workflow updates
- Use rust version of gib

## [1.0.0] - 2024-05-13

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gib"
version = "1.0.3"
version = "1.0.4"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down

0 comments on commit 0addbc3

Please sign in to comment.