Build and publish binaries after new release #71
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This new workflow runs after a github release is published. It builds for 5 targets, and after all 5 builds are successful The newly built releases are published to the release tag
This serves 2 goals
openapi-codegen
to generate our rust Lib. Now we don't need to re-compile (and take up cache space) every time we run the Libs/Rust CIcargo-dist
License
I added the MIT License so that the
tar.xz/zip
files will have a LICENSE file included, but this is not really needed.If this is an issue, I can easily remove the License
How it works
After creating (and publishing) a new release from the GitHub UI, The workflow is triggered.
For the macos/linux builds I use
cargo zigbuild
, it uses the zig linker, allowing me to easily cross compile for arm/x86I chose
cargo zigbuild
because this is what we (cargo-dist
) already use insvix-webhooks
, and it's very simple to use.Homebrew is used to install needed dependencies
zig
cargo-zigbuild
coreutils
(sha256sum
comes fromcoreutils
)zig
cargo-zigbuild
The resulting binary along with
README.md
andLICENSE
is packaged in aopenapi-codegen-{target triplet}.(tar.xz/zip)
file.On windows I package a
zip
file instead of atar.xz
(Some windows users may be unable to open atar.xz
archiveThe sha256sum of the
tar.xz/zip
file is added to a file namedopenapi-codegen-{target triplet}.(tar.xz/zip).sha256