diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e0d3254..9d7f8b7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,7 @@ name: Build and Test +permissions: + contents: read + pull-requests: write on: push: branches: @@ -18,8 +21,10 @@ jobs: mac-backend: jdk - image: macos-latest mac-backend: fsevents + - image: macos-13 + mac-backend: fsevents - image: windows-latest - jdk: [11, 17, 21] + jdk: [11, 21] fail-fast: false runs-on: ${{ matrix.os.image }} @@ -32,9 +37,8 @@ jobs: java-version: ${{ matrix.jdk }} distribution: 'temurin' cache: 'maven' - #- uses: actions-rust-lang/setup-rust-toolchain@v1 - run: ./update-rust-jni-libs.sh -r - if: ${{ matrix.os.image == 'macos-latest' }} + if: startsWith(matrix.os.image, 'macos-') - name: test run: mvn -B clean test "-Dwatch.mac.backend=${{ matrix.os.mac-backend }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1f66989..216684b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,12 +1,19 @@ name: Publish package maven +permissions: + contents: read + pull-requests: read on: release: types: [created] jobs: publish: - runs-on: ubuntu-latest + runs-on: macos-latest # for now build on macos for the jni steps: - uses: actions/checkout@v4 + + # build jni libs on osx + - run: ./update-rust-jni-libs.sh -r + - uses: actions/setup-java@v4 with: java-version: '11' @@ -22,4 +29,4 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }} \ No newline at end of file + GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }} diff --git a/README.md b/README.md index c20623e..6273277 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Features: - monitor a directory for changes to its direct children - monitor a directory for changes for all its descendants (aka recursive directory watch) - 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)) +- Java 11 and higher are supported - edge cases dealt with: - recursive watches will also continue in new directories - multiple watches for the same directory are merged to avoid overloading the kernel @@ -25,8 +26,6 @@ Planned features: - Support single file watches natively in linux (see [#11](https://github.com/SWAT-engineering/java-watch/issues/11)) - Monitor only specific events (such as only CREATE events) - - ## Usage Import dependency in pom.xml: