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: Remove macOS universal build #217

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 22 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ jobs:
target_name: lunatic
asset_name: lunatic-linux-amd64.tar.gz
content_type: application/gzip
- os: macos-11
- os: macos-latest
target_name: lunatic
asset_name: lunatic-macos-universal.tar.gz
content_type: application/gzip
- os: windows-latest
target_name: lunatic.exe
Expand Down Expand Up @@ -62,21 +61,25 @@ jobs:
run: |
cargo build --release
mv ./target/release/${{ matrix.target_name }} ${{ matrix.target_name }}
- name: Build project on macOs and package into universal binary
- name: Build project on macOS
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS'
run: |
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
lipo -create -output lunatic target/aarch64-apple-darwin/release/lunatic target/x86_64-apple-darwin/release/lunatic
- name: Tar release on Unix
if: startsWith(github.ref, 'refs/tags/') && runner.os != 'Windows'
- name: Tar release on Linux
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux'
run: tar czf ${{ matrix.asset_name }} README.md LICENSE-MIT LICENSE-APACHE ${{ matrix.target_name }}
- name: Zip release on Windows
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows'
uses: vimtor/action-zip@v1
with:
files: README.md LICENSE-MIT LICENSE-APACHE ${{ matrix.target_name }}
dest: ${{ matrix.asset_name }}
- name: Tar release on macOS
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS'
run: |
tar -czf lunatic-macos-x86_64.tar.gz README.md LICENSE-MIT LICENSE-APACHE -C target/x86_64-apple-darwin/release lunatic
tar -czf lunatic-macos-aarch64.tar.gz README.md LICENSE-MIT LICENSE-APACHE -C target/aarch64-apple-darwin/release lunatic
- name: Get release name
if: startsWith(github.ref, 'refs/tags/')
id: getReleaseName
Expand All @@ -89,12 +92,23 @@ jobs:
/^## ${{ steps.getReleaseName.outputs.RELEASE_NAME }}/ { STATE="catch" }
/^Released [0-9]+-[0-9]+-[0-9]+/ && STATE=="catch" { STATE="show" }' CHANGELOG.md \
| awk 'NF { SHOW=1 } SHOW' > RELEASE_NOTES.md
- name: Release
if: startsWith(github.ref, 'refs/tags/')
- name: Release Windows and Linux
if: startsWith(github.ref, 'refs/tags/') && runner.os != 'macOS'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.getReleaseName.outputs.RELEASE_NAME }}
name: Lunatic ${{ steps.getReleaseName.outputs.RELEASE_NAME }}
body_path: RELEASE_NOTES.md
draft: true
files: ${{ matrix.asset_name }}
- name: Release macOS
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.getReleaseName.outputs.RELEASE_NAME }}
name: Lunatic ${{ steps.getReleaseName.outputs.RELEASE_NAME }}
body_path: RELEASE_NOTES.md
draft: true
files: |
lunatic-macos-x86_64.tar.gz
lunatic-macos-aarch64.tar.gz
18 changes: 0 additions & 18 deletions .github/workflows/homebrew.yml

This file was deleted.

10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ cargo install lunatic-runtime

---

On **macOS** you can use [Homebrew][6] too:

```bash
brew tap lunatic-solutions/lunatic
brew install lunatic
```

---

We also provide pre-built binaries for **Windows**, **Linux** and **macOS** on the
[releases page][5], that you can include in your `PATH`.

Expand Down Expand Up @@ -137,7 +128,6 @@ at your option.
[3]: https://crates.io/crates/lunatic
[4]: https://discord.gg/b7zDqpXpB4
[5]: https://github.com/lunatic-solutions/lunatic/releases
[6]: https://brew.sh/
[7]: https://rustup.rs/
[8]: https://golangbot.com/goroutines
[9]: https://tokio.rs
Expand Down
7 changes: 4 additions & 3 deletions crates/lunatic-distributed-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ where
Certificate::from_params(cert_params).or_trap("lunatic::distributed::sign_node")?;

let Ok(cert_pem) = CertificateSigningRequest::from_pem(csr_pem)
.and_then(|sign_request| sign_request.serialize_pem_with_signer(&ca_cert)) else {
return Ok(0);
};
.and_then(|sign_request| sign_request.serialize_pem_with_signer(&ca_cert))
else {
return Ok(0);
};

let data = bincode::serialize(&cert_pem).or_trap("lunatic::distributed::sign_node")?;
let ptr = write_to_guest_vec(&mut caller, &memory, &data, len_ptr)
Expand Down