Skip to content

Commit 455d2aa

Browse files
authored
chore(nuget): Add support for macosx (microsoft#553)
Additionally - Include more metadata in nuget package - Also generate snupkg for native symbols. We intentionally don't add the symbols for native rust shared library to the nuget package since that could increase the size of the nuget. We will revisit that later. - update licenses of all the bindings. closes microsoft#551 Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
1 parent 0e5fe9b commit 455d2aa

12 files changed

Lines changed: 80 additions & 11 deletions

File tree

.github/workflows/test-csharp.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@ jobs:
3131
target: x86_64-unknown-linux-gnu
3232
libpath: |
3333
**/release/libregorus_ffi.so
34-
# Disabled for now
35-
#- os: macos-latest
36-
# target: aarch64-apple-darwin
37-
# libpath: |
38-
# **/release/libregorus_ffi.dylib
34+
- os: macos-latest
35+
target: aarch64-apple-darwin
36+
libpath: |
37+
**/release/libregorus_ffi.dylib
3938
steps:
4039
- name: Checkout repository
4140
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
4241
with:
4342
fetch-depth: 0
4443
- uses: ./.github/actions/toolchains/rust
44+
with:
45+
targets: ${{ matrix.runtime.target }}
4546
- name: Cache cargo
4647
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
4748
with:
@@ -99,13 +100,15 @@ jobs:
99100
run: ls -R ./bindings/csharp/Regorus/tmp
100101

101102
- name: Build Regorus nuget via xtask
102-
run: cargo xtask build-csharp --release --clean --artifacts-dir ./bindings/csharp/Regorus/tmp/bindings/ffi/target --enforce-artifacts
103+
run: cargo xtask build-csharp --release --clean --artifacts-dir ./bindings/csharp/Regorus/tmp/bindings/ffi/target --enforce-artifacts --repository-commit ${{ github.sha }} --include-symbols
103104

104105
- name: Upload Regorus nuget
105106
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
106107
with:
107108
name: regorus-nuget
108-
path: bindings/csharp/Regorus/bin/Release/Regorus*.nupkg
109+
path: |
110+
bindings/csharp/Regorus/bin/Release/Regorus*.nupkg
111+
bindings/csharp/Regorus/bin/Release/Regorus*.snupkg
109112
if-no-files-found: error
110113
retention-days: 1
111114

@@ -122,8 +125,8 @@ jobs:
122125
target: x86_64-pc-windows-msvc
123126
- os: ubuntu-latest
124127
target: x86_64-unknown-linux-gnu
125-
#- os: macos-latest
126-
# target: aarch64-apple-darwin
128+
- os: macos-latest
129+
target: aarch64-apple-darwin
127130
steps:
128131
- name: Checkout repository
129132
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

bindings/csharp/Regorus/Regorus.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
<VersionPrefix>0.9.0</VersionPrefix>
1212
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
1313
<PackageReadmeFile>README.md</PackageReadmeFile>
14+
<PackageLicenseExpression>MIT AND Apache-2.0 AND BSD-3-Clause</PackageLicenseExpression>
15+
<PackageProjectUrl>https://github.com/microsoft/regorus</PackageProjectUrl>
16+
<RepositoryUrl>https://github.com/microsoft/regorus</RepositoryUrl>
17+
<RepositoryType>git</RepositoryType>
18+
<Authors>Microsoft</Authors>
19+
<Company>Microsoft</Company>
20+
<PackageTags>rego;policy;engine;authorization;opa;rust</PackageTags>
21+
<Description>Fast, lightweight Rego interpreter and policy engine for .NET, powered by Rust.</Description>
22+
<Copyright>Copyright (c) Microsoft Corporation.</Copyright>
1423
</PropertyGroup>
1524

1625
<PropertyGroup>
@@ -46,10 +55,14 @@
4655

4756
<Error Text="$(RegorusFFIArtifactsDir)/x86_64-unknown-linux-gnu/$(RegorusFFIArtifactsProfile)/libregorus_ffi.so missing."
4857
Condition="!Exists('$(RegorusFFIArtifactsDir)/x86_64-unknown-linux-gnu/$(RegorusFFIArtifactsProfile)/libregorus_ffi.so')" />
58+
59+
<Error Text="$(RegorusFFIArtifactsDir)/aarch64-apple-darwin/$(RegorusFFIArtifactsProfile)/libregorus_ffi.dylib missing."
60+
Condition="!Exists('$(RegorusFFIArtifactsDir)/aarch64-apple-darwin/$(RegorusFFIArtifactsProfile)/libregorus_ffi.dylib')" />
4961
</Target>
5062

5163
<ItemGroup>
5264
<None Include="docs/README.md" Pack="true" PackagePath="/" />
65+
<None Include="../../../LICENSE" Pack="true" PackagePath="/" />
5366

5467
<!-- Copy each binary to expected location within the package -->
5568
<None Include="$(RegorusFFIArtifactsDir)/x86_64-pc-windows-msvc/$(RegorusFFIArtifactsProfile)/*.dll" Pack="true" PackagePath="runtimes/win-x64/native/" />

bindings/ffi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
name = "regorus-ffi"
55
version = "0.9.0"
66
edition = "2021"
7+
license = "MIT AND Apache-2.0 AND BSD-3-Clause"
78

89
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
910
[lib]

bindings/java/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version = "0.9.0"
66
edition = "2021"
77
repository = "https://github.com/microsoft/regorus/bindings/java"
88
description = "Java bindings for Regorus - a fast, lightweight Rego interpreter written in Rust"
9+
license = "MIT AND Apache-2.0 AND BSD-3-Clause"
910
keywords = ["interpreter", "opa", "policy-as-code", "rego"]
1011

1112
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

bindings/java/pom.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@
1818
<licenses>
1919
<license>
2020
<name>MIT License</name>
21-
<url>https://opensource.org/blog/license/mit</url>
21+
<url>https://opensource.org/licenses/MIT</url>
22+
</license>
23+
<license>
24+
<name>Apache License 2.0</name>
25+
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
26+
</license>
27+
<license>
28+
<name>BSD 3-Clause License</name>
29+
<url>https://opensource.org/licenses/BSD-3-Clause</url>
2230
</license>
2331
</licenses>
2432

bindings/python/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version = "0.9.0"
66
edition = "2021"
77
repository = "https://github.com/microsoft/regorus/bindings/python"
88
description = "Python bindings for Regorus - a fast, lightweight Rego interpreter written in Rust"
9+
license = "MIT AND Apache-2.0 AND BSD-3-Clause"
910
keywords = ["interpreter", "opa", "policy-as-code", "rego"]
1011

1112

bindings/python/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ build-backend = "maturin"
55
[project]
66
name = "regorus"
77
requires-python = ">=3.8"
8+
license = { text = "MIT AND Apache-2.0 AND BSD-3-Clause" }
89
classifiers = [
10+
"License :: OSI Approved :: Apache Software License",
11+
"License :: OSI Approved :: BSD License",
12+
"License :: OSI Approved :: MIT License",
913
"Programming Language :: Rust",
1014
"Programming Language :: Python :: Implementation :: CPython",
1115
"Programming Language :: Python :: Implementation :: PyPy",

bindings/ruby/ext/regorusrb/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "regorusrb"
33
version = "0.9.0"
44
edition = "2024"
55
description = "Ruby bindings for Regorus - a fast, lightweight Rego interpreter written in Rust"
6+
license = "MIT AND Apache-2.0 AND BSD-3-Clause"
67
publish = false
78

89
[lib]

bindings/ruby/regorusrb.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
99

1010
spec.summary = "Ruby bindings for Regorus - a fast, lightweight Rego interpreter written in Rust"
1111
spec.homepage = "https://github.com/microsoft/regorus/blob/main/bindings/ruby"
12-
spec.license = "MIT"
12+
spec.licenses = ["MIT", "Apache-2.0", "BSD-3-Clause"]
1313
spec.required_ruby_version = ">= 3.4.2"
1414
spec.required_rubygems_version = ">= 3.6.5"
1515

bindings/wasm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version = "0.9.0"
66
edition = "2021"
77
repository = "https://github.com/microsoft/regorus/bindings/wasm"
88
description = "WASM bindings for Regorus - a fast, lightweight Rego interpreter written in Rust"
9+
license = "MIT AND Apache-2.0 AND BSD-3-Clause"
910
keywords = ["interpreter", "opa", "policy-as-code", "rego"]
1011

1112
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

0 commit comments

Comments
 (0)