Skip to content

Commit

Permalink
build: use xmlstarlet over xmllint in build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
R-unic committed Jul 21, 2024
1 parent 889c054 commit d0822eb
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: Build
run: dotnet build -c Release --no-restore

- name: Install xmllint
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: Install xmlstarlet
run: sudo apt-get update && sudo apt-get install -y xmlstarlet

- name: Generate Files
run: TypeGenerator/bin/Release/net8.0/TypeGenerator -o RobloxTypes
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
fi
# Extract current version from .csproj
CURRENT_VERSION=$(xmllint --xpath "string(//Project/PropertyGroup/Version)" ./RobloxTypes/RobloxTypes.csproj)
CURRENT_VERSION=$(xmlstarlet sel -t -v "//Project/PropertyGroup/Version" ./RobloxTypes/RobloxTypes.csproj)
echo "Current version: $CURRENT_VERSION"
# Increment patch version
Expand All @@ -82,12 +82,7 @@ jobs:
echo "New version: $NEW_VERSION"
# Update version in .csproj
xmllint --shell ./RobloxTypes/RobloxTypes.csproj << EOF
cd //Project/PropertyGroup/Version
set ${NEW_VERSION}
save
quit
EOF
xmlstarlet ed -L -u "//Project/PropertyGroup/Version" -v "$NEW_VERSION" ./RobloxTypes/RobloxTypes.csproj
# Commit version change
git add ./RobloxTypes/RobloxTypes.csproj
Expand Down

0 comments on commit d0822eb

Please sign in to comment.