diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dff575428..881a517be 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 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 @@ -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 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 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)