protocolbuffers / protobuf-javascript

BSD 3-Clause "New" or "Revised" License
351 stars 67 forks source link

Windows 32/64 Github Action Builds #166

Closed yinzara closed 1 year ago

yinzara commented 1 year ago

Fixes #142

This PR includes minor changes to the Bazel build process and new GitHub Actions/Workflows to facilitate building the Windows 32/64 release zip files using the Visual Studio toolset ensuring it's compatibility on all Windows systems (not just in minGW). The Bazel changes should be compatible with existing internal build processes and should not affect the non-Windows releases controlled by Google's internal build system. They are only so we can pass the "--cpu" argument in Github Actions and properly name the output release file.

See the release created by the tag submitted with this PR at: https://github.com/yinzara/protobuf-javascript/releases/v3.21.2

I was actually successful in building the Mac OS x86/ARM and Linux x86_64 releases as well. https://github.com/yinzara/protobuf-javascript/releases/tag/v3.21.2-yinzara-2

Unfortunately building the other architectures would either require a new toolchain or potentially using https://github.com/uraimo/run-on-arch-action. However, either was beyond the scope I was tackling and both wouldn't be able to produce the x86_32 architecture.

I've disabled the Mac OS and Linux builds in the github action workflow file for now (with comment explaining why).

If a release was already created via an internal tool before the tag is pushed to Github, this should properly add to the existing release (instead of creating a new one) because of the svenstaro/upload-release-action@v2 behavior.

I tested this by rerunning the release step of the build and it only updated the executables without creating a new release. Initial release: https://github.com/yinzara/protobuf-javascript/actions/runs/4379577450/attempts/1

Rebuild: https://github.com/yinzara/protobuf-javascript/actions/runs/4379577450

I suggest after this PR is merged that someone take the auto build win32/win64.zip files and update the existing 3.21.2 release so that people downloading the new files will have the fixed version that works in Powershell and Windows apps.

dibenede commented 1 year ago

Overall this looks fantastic. Thank you for putting it together!

yinzara commented 1 year ago

Any chance we could get the existing win32 and win64 zip files in the 3.21.2 release updated with the versions built by the main action build?

dibenede commented 1 year ago

Yes, planning to, just ran out of time the other day. I'll ping the bug thread when it's done.