Bump to 0.2.9 and remove jda-nas requirement #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish-natives-macos | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- '.github/workflows/publish-mac.yml' # when new targets are added | |
- 'build.gradle.kts' # when the root build script changes | |
- 'api' # when api source is changed | |
- 'native' # when natives are changed | |
concurrency: | |
group: "pub-mac" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build macOS universal binary | |
environment: MavenRelease | |
runs-on: macos-11 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Compile natives | |
working-directory: native | |
run: | | |
rustup target add x86_64-apple-darwin | |
cargo build -r --target=x86_64-apple-darwin | |
rustup target add aarch64-apple-darwin | |
cargo build -r --target=aarch64-apple-darwin | |
- name: Create target directory for darwin | |
run: mkdir -p native/target/darwin/release | |
- name: Combine to universal dylib | |
run: lipo -create -output native/target/darwin/release/libudpqueue.dylib native/target/**/release/*.dylib | |
- name: Publish | |
env: | |
ORG_GRADLE_PROJECT_ossrhUser: ${{ secrets.OSSRH_USER }} | |
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_stagingProfile: ${{ secrets.STAGING_PROFILE_ID }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} | |
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEYID }} | |
run: | | |
chmod u+x gradlew | |
./gradlew --console plain --stacktrace -Ptarget=darwin native:publishToSonatype closeAndReleaseStagingRepository |