Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update build on dotnet to use release artifacts #158

Merged
merged 22 commits into from
Oct 31, 2024

Conversation

sighphyre
Copy link
Member

@sighphyre sighphyre commented Oct 30, 2024

Binary build is now handled by a completely different task that's fired on cargo smart-release (or just pushing a tag, but don't do that).

The .NET build now picks up the binaries from the release artifacts, and uses an internal property - YggdrasilCoreVersion in its build files to set the version of Yggdrasil FFI that will be used. This means that our versioning is now tracked in source control

cd dotnet-engine
version=${{ github.event.inputs.version }}
sed -i "s/<Version>.*<\/Version>/<Version>$version<\/Version>/" Yggdrasil.Engine/Yggdrasil.Engine.csproj
binaries=("libyggdrasilffi_aarch64.so linux/aarch64/libyggdrasilffi.so"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to have this list of binaries defined in one place across all builds but I can't see an obvious and sane way to do that right now

For the .NET case, we also have to put the binaries in specific locations, which makes this more challenging to abstract

Open to suggestions, but I'll probably do that in a future PR

dotnet restore dotnet-engine.sln
sudo apt-get install -y xmlstarlet
cd dotnet-engine/Yggdrasil.Engine
CORE_VERSION=$(xmlstarlet sel -t -v "/Project/PropertyGroup/YggdrasilCoreVersion" -n Yggdrasil.Engine.csproj)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dirty little cheat to pull the version property for Ygg out the raw XML, because apparently msbuild doesn't give you an option to do that from the command line #sad

@sighphyre sighphyre marked this pull request as ready for review October 30, 2024 07:02
@sighphyre sighphyre changed the title Chore/update build on dotnet chore: update build on dotnet to use release artifacts Oct 30, 2024
Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff

@sighphyre sighphyre force-pushed the chore/update-build-on-dotnet branch 4 times, most recently from 8996fde to 0a71087 Compare October 30, 2024 14:04
@sighphyre sighphyre merged commit 0e7f9ff into main Oct 31, 2024
5 of 6 checks passed
@sighphyre sighphyre deleted the chore/update-build-on-dotnet branch October 31, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants