Skip to content
New issue

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

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

Already on GitHub? # to your account

Build and publish binaries after new release #71

Closed
wants to merge 1 commit into from

Conversation

svix-mman
Copy link
Contributor

@svix-mman svix-mman commented Feb 23, 2025

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

  1. In svix-webhooks CI, we use the 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 CI
  2. Dipping our toes into building/publishing binaries without cargo-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/x86
I chose cargo zigbuild because this is what we (cargo-dist) already use in svix-webhooks, and it's very simple to use.

Homebrew is used to install needed dependencies

  • On macos: zig cargo-zigbuild coreutils (sha256sum comes from coreutils)
  • On linux: zig cargo-zigbuild

The resulting binary along with README.md and LICENSE is packaged in a openapi-codegen-{target triplet}.(tar.xz/zip) file.
On windows I package a zip file instead of a tar.xz (Some windows users may be unable to open a tar.xz archive

The sha256sum of the tar.xz/zip file is added to a file named openapi-codegen-{target triplet}.(tar.xz/zip).sha256

@svix-mman svix-mman requested a review from a team as a code owner February 23, 2025 01:07
@svix-mman
Copy link
Contributor Author

svix-mman commented Feb 23, 2025

@tasn I added an MIT License in this PR
Let me know if that's ok

@svix-mman svix-mman force-pushed the mendy/add-release-ci branch from ce7bd1f to 96ace85 Compare February 23, 2025 21:02
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
@svix-mman svix-mman force-pushed the mendy/add-release-ci branch from 96ace85 to 07bcfab Compare February 24, 2025 14:24
@svix-mman
Copy link
Contributor Author

Maybe one day, but today is not the day

@svix-mman svix-mman closed this Feb 24, 2025
@svix-mman svix-mman deleted the mendy/add-release-ci branch February 24, 2025 17:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants