From d45662a9c92d0808477b3201b85a442dfbe6600d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Ko=C5=A1ti=C4=87?= Date: Wed, 23 Aug 2023 13:30:59 +0200 Subject: [PATCH 1/4] chore: Remove macOS universal build - Release separate binaries for x86_64 and aarch64 --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dff575428..6ab510e60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -62,14 +61,13 @@ 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' @@ -77,6 +75,11 @@ jobs: 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 README.md LICENSE-MIT LICENSE-APACHE target/x86_64-apple-darwin/release/lunatic + tar czf lunatic-macos-aarch64.tar.gz README.md README.md LICENSE-MIT LICENSE-APACHE target/aarch64-apple-darwin/release/lunatic - name: Get release name if: startsWith(github.ref, 'refs/tags/') id: getReleaseName @@ -89,8 +92,8 @@ 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 }} @@ -98,3 +101,14 @@ jobs: 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 From c6712f55440ece8f6f4d628ac44937021288b54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Ko=C5=A1ti=C4=87?= Date: Mon, 28 Aug 2023 10:06:56 +0200 Subject: [PATCH 2/4] Don't bundle directory structure in the release --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ab510e60..881a517be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,8 +78,8 @@ jobs: - 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 README.md LICENSE-MIT LICENSE-APACHE target/x86_64-apple-darwin/release/lunatic - tar czf lunatic-macos-aarch64.tar.gz README.md README.md LICENSE-MIT LICENSE-APACHE target/aarch64-apple-darwin/release/lunatic + 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 From 66e716d04d359ba5fd119a49f3dedf3d0467143e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Ko=C5=A1ti=C4=87?= Date: Mon, 28 Aug 2023 10:13:13 +0200 Subject: [PATCH 3/4] Fix formatting errors --- crates/lunatic-distributed-api/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/lunatic-distributed-api/src/lib.rs b/crates/lunatic-distributed-api/src/lib.rs index e8f14fb7d..932a51015 100644 --- a/crates/lunatic-distributed-api/src/lib.rs +++ b/crates/lunatic-distributed-api/src/lib.rs @@ -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) From c55152e42cc4afb46e5bbb6fbdf47504067f00ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Ko=C5=A1ti=C4=87?= Date: Tue, 29 Aug 2023 09:43:16 +0200 Subject: [PATCH 4/4] Remove Homebrew installation support --- .github/workflows/homebrew.yml | 18 ------------------ README.md | 10 ---------- 2 files changed, 28 deletions(-) delete mode 100644 .github/workflows/homebrew.yml diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml deleted file mode 100644 index 0621e27ab..000000000 --- a/.github/workflows/homebrew.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Update lunatic homebrew version -on: - release: - types: published -jobs: - update-version: - runs-on: ubuntu-latest - steps: - - name: "Update version" - run: | - export VERSION=$(echo ${GITHUB_REF/refs\/tags\//} | sed -E 's/.*v([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)/\1/') - curl -X POST \ - -H 'Authorization: token ${{ secrets.HOMEBREW }}' \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/lunatic-solutions/homebrew-lunatic/actions/workflows/ci.yml/dispatches \ - -d '{"ref": "main", - "inputs": { "version": "'$VERSION'" } - }' diff --git a/README.md b/README.md index 8a86abe92..65b87ea05 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -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