Skip to content

Commit 2b0bcbc

Browse files
authored
Merge pull request #65 from SWAT-engineering/chore/tune-ci-scripts-for-macos
Tune CI scripts for macOS
2 parents 3435479 + 0a35b7d commit 2b0bcbc

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: Build and Test
2+
permissions:
3+
contents: read
4+
pull-requests: write
25
on:
36
push:
47
branches:
@@ -18,8 +21,10 @@ jobs:
1821
mac-backend: jdk
1922
- image: macos-latest
2023
mac-backend: fsevents
24+
- image: macos-13
25+
mac-backend: fsevents
2126
- image: windows-latest
22-
jdk: [11, 17, 21]
27+
jdk: [11, 21]
2328

2429
fail-fast: false
2530
runs-on: ${{ matrix.os.image }}
@@ -32,9 +37,8 @@ jobs:
3237
java-version: ${{ matrix.jdk }}
3338
distribution: 'temurin'
3439
cache: 'maven'
35-
#- uses: actions-rust-lang/setup-rust-toolchain@v1
3640
- run: ./update-rust-jni-libs.sh -r
37-
if: ${{ matrix.os.image == 'macos-latest' }}
41+
if: startsWith(matrix.os.image, 'macos-')
3842

3943
- name: test
4044
run: mvn -B clean test "-Dwatch.mac.backend=${{ matrix.os.mac-backend }}"

.github/workflows/release.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
name: Publish package maven
2+
permissions:
3+
contents: read
4+
pull-requests: read
25
on:
36
release:
47
types: [created]
58
jobs:
69
publish:
7-
runs-on: ubuntu-latest
10+
runs-on: macos-latest # for now build on macos for the jni
811
steps:
912
- uses: actions/checkout@v4
13+
14+
# build jni libs on osx
15+
- run: ./update-rust-jni-libs.sh -r
16+
1017
- uses: actions/setup-java@v4
1118
with:
1219
java-version: '11'
@@ -22,4 +29,4 @@ jobs:
2229
env:
2330
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }}
2431
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
25-
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}
32+
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Features:
1313
- monitor a directory for changes to its direct children
1414
- monitor a directory for changes for all its descendants (aka recursive directory watch)
1515
- high-resolution events (on macOS we use the native [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) API to circumvent the polling behavior of the JDK [WatchService](https://docs.oracle.com/javase/8/docs/api/java/nio/file/WatchService.html))
16+
- Java 11 and higher are supported
1617
- edge cases dealt with:
1718
- recursive watches will also continue in new directories
1819
- multiple watches for the same directory are merged to avoid overloading the kernel
@@ -25,8 +26,6 @@ Planned features:
2526
- Support single file watches natively in linux (see [#11](https://github.com/SWAT-engineering/java-watch/issues/11))
2627
- Monitor only specific events (such as only CREATE events)
2728

28-
29-
3029
## Usage
3130

3231
Import dependency in pom.xml:

0 commit comments

Comments
 (0)