Skip to content

Commit

Permalink
chore: correct the OSX release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Aug 17, 2021
1 parent 64cf38e commit 3215821
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,27 @@ npm i -g cz-conventional-changelog

`git cz` to commit and commitizen will guide you.

### Building

To build the libraries in this project, you need a working Rust environment. Refer to the [Rust Guide](https://www.rust-lang.org/learn/get-started).

The build tool used is `cargo`.

```shell
cd rust
cargo build
```

This will compile all the libraries and put the generated files in `rust/target/debug`.

### Releasing

The released libraries for each module are built by a GH action that attaches the libraries to the GH release for each
crate. To release a crate, run the `release.groovy` script in the crate directory. This will guide you through the
release process for the crate. Then create a GH release using the tag and changelog created by the script.

To be able to release a component, you need to:
1. Have an account on [crates.io](crates.io). Go to that site, and select "Log in with GitHub". It will auto-create your user account.
2. Get a maintainer to invite you to the crate for the component.
3. Accept the invite on crates.io. This will allow you to release the Rust crate to crates.io.
4.
2 changes: 1 addition & 1 deletion rust/pact_ffi/conan/dll/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class CbindgenTestConan(ConanFile):
name = "pact_ffi_dll"
version = "0.0.1"
version = "0.0.2"
description = "Pact/Rust FFI bindings (DLL/Shared Lib)"
url = "https://pactfoundation.jfrog.io/artifactory/pactfoundation-conan/"
homepage = "https://github.com/pact-foundation/pact-reference"
Expand Down
2 changes: 1 addition & 1 deletion rust/pact_ffi/conan/lib/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class CbindgenTestConan(ConanFile):
name = "pact_ffi"
version = "0.0.1"
version = "0.0.2"
description = "Pact/Rust FFI bindings"
url = "https://pactfoundation.jfrog.io/artifactory/pactfoundation-conan/"
homepage = "https://github.com/pact-foundation/pact-reference"
Expand Down
6 changes: 5 additions & 1 deletion rust/pact_ffi/release-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ rustup run nightly cbindgen \
--config cbindgen.toml \
--crate pact_ffi \
--output include/pact.h
cp include/pact.h ../target/artifacts
rustup run nightly cbindgen \
--config cbindgen-c++.toml \
--crate pact_ffi \
--output include/pact-cpp.h
cp include/*.h ../target/artifacts
gzip -c ../target/release/libpact_ffi.so > ../target/artifacts/libpact_ffi-linux-x86_64.so.gz
openssl dgst -sha256 -r ../target/artifacts/libpact_ffi-linux-x86_64.so.gz > ../target/artifacts/libpact_ffi-linux-x86_64.so.gz.sha256
gzip -c ../target/release/libpact_ffi.a > ../target/artifacts/libpact_ffi-linux-x86_64.a.gz
Expand Down
3 changes: 1 addition & 2 deletions rust/pact_ffi/release-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ gzip -c ../target/release/libpact_ffi.a > ../target/artifacts/libpact_ffi-osx-x8
openssl dgst -sha256 -r ../target/artifacts/libpact_ffi-osx-x86_64.a.gz > ../target/artifacts/libpact_ffi-osx-x86_64.a.gz.sha256

# M1
cargo clean
export SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path)
export MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version)
cargo build --target aarch64-apple-darwin --release

gzip -c ../target/aarch64-apple-darwin/release/libpact_ffi.dylib > ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz
openssl dgst -sha256 -r ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz > ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz.sha256
gzip -c ../target/aarch64-apple-darwin/release/libpact_ffi.a > ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.a.gz
openssl dgst -sha256 -r ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.a.gz > ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.a.gz.sha256
openssl dgst -sha256 -r ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.a.gz > ../target/artifacts/libpact_ffi-osx-aarch64-apple-darwin.a.gz.sha256

0 comments on commit 3215821

Please sign in to comment.