Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Dec 17, 2024
1 parent 212cc46 commit 59f40cb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,15 @@ jobs:
# Otherwise use the version number in the engine/Cargo.toml and append it with -alpha
- name: Update version number
run: |
if [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
# Extract version number from tag (remove refs/tags/v prefix)
if [[ "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
echo "Release tag detected, using version: $VERSION"
# update the version in Cargo.toml
sed -i "s/^version = .*/version = \"${VERSION}\"/" engine/Cargo.toml
else
echo "No release tag detected, using version from Cargo.toml"
version=$(grep -oP '(?<=version = ")[^"]+' engine/Cargo.toml)
# update the version in Cargo.toml
# parse version from Cargo.toml using regex
version=$(grep -oP 'version = "([^"]+)"' engine/Cargo.toml | sed 's/^version = "\(.*\)"$/\1/')
echo "Current version: $version"
sed -i "s/^version = .*/version = \"${version}-alpha\"/" engine/Cargo.toml
fi
Expand Down

0 comments on commit 59f40cb

Please sign in to comment.