Closed whimsical-c4lic0 closed 1 day ago
Would it be possible to pass the version in as an argument to dotnet build
in some fashion, rather than having to have it checked in manually?
You're right. That's a better solution. I didn't think of that. I just pushed an update to remove the version from the .csproj file in favor of just using a build argument. (e.g. -p Version=1.7.61
). I also updated the dockerfile and github actions to include the build argument.
Just a quick thing I want to clarify, I currently create the .exe for the release zip files in Visual Studio, with this change will I need to use the cmd instead with the new argument?
I believe you can specify it in VS as well, but I'm not exactly sure how... I've used VSCode a bunch, but not VS itself. There's some discussion about it here that may make more sense to you as a VS user: https://stackoverflow.com/questions/8446693/specify-assembly-version-number-as-a-command-line-argument-in-msbuild - specifically the part about using an assembly task seems like it would be what you're looking for, but that's a best guess.
Alternatively, we could look at automating the release builds with a GitHub Action, similar to how the GHCR Docker images are being created when a new tag is pushed. I've got some recent GHA experience from work, and with what's already being done for Docker, I don't think it would be difficult on this repo.
@melithine You beat me to the punch :laughing:
CLI or github actions would definitely be easier, but it should be possible within visual studio. I use Rider, so unfortunately I can't be of any help with visual studio settings though.
I was going to suggest Github actions as that will save me a bunch of time so I'll look into it tomorrow
LMK if you hit any snags.
LMK if you hit any snags.
I'm a complete noob when it comes to Github actions so if you think you could do it then go for it, if not then no worries
LMK if you hit any snags.
I'm a complete noob when it comes to Github actions so if you think you could do it then go for it, if not then no worries
I have this mostly working, but I'm not seeing where the generic auth.json
and config.json
are to include in the zip file. We might need to add a CHANGELOG.md file to track info about the release notes as well, but you can see things here: https://github.com/melithine/OF-DL/releases/tag/OFDLV9.99.111 with the GHA being here: https://github.com/melithine/OF-DL/blob/master/.github/workflows/publish-release.yml (the build log for that is here: https://github.com/melithine/OF-DL/actions/runs/9703192928)
LMK if you hit any snags.
I'm a complete noob when it comes to Github actions so if you think you could do it then go for it, if not then no worries
I have this mostly working, but I'm not seeing where the generic
auth.json
andconfig.json
are to include in the zip file. We might need to add a CHANGELOG.md file to track info about the release notes as well, but you can see things here: https://github.com/melithine/OF-DL/releases/tag/OFDLV9.99.111 with the GHA being here: https://github.com/melithine/OF-DL/blob/master/.github/workflows/publish-release.yml (the build log for that is here: https://github.com/melithine/OF-DL/actions/runs/9703192928)
I'm surprised you're able to create an .exe from a ubuntu runner. I thought that you'd need to use a windows runner to create a windows executable.
Yeah, I saw that you can build for different runtimes using any of them with dotnet (including Darwin, but that wouldn't really be very supportable for us) and gave that a whirl.
I've noticed in discord that users frequently confused about their program version. Also, users frequently post screenshots of their console output. By printing the program version on start-up, a lot of common back-and-forth in discord can be eliminated.
A downside of this functionality, though,
is that you will need to manually update the version inis that you'll need to use an additional build argument when building releases (e.g.OF DL/OF DL.csproj
before each release.-p Version=1.7.61
). I personally think the trade-off is worth it, but I won't be the one updating the version each time :laughing:In the future, a config option can be added to automatically check for updates. A github API request could be made to compare the current program version to the most recent release on github.