diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index 40839a9f..ccadc181 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -2,9 +2,30 @@ name: Build Native on: workflow_dispatch: + push: + branches: + - master + - main + paths: + - 'src/main/resources/org/xerial/snappy/VERSION' + - 'Makefile' + - 'Makefile.common' + - '**/*.h' + - '**/*.cpp' + - .github/workflows/build-native.yml + pull_request: + paths: + - 'src/main/resources/org/xerial/snappy/VERSION' + - 'Makefile' + - 'Makefile.common' + - '**/*.h' + - '**/*.cpp' jobs: build: + permissions: + contents: write + pull-requests: write name: Build native libraries runs-on: ubuntu-latest steps: @@ -13,25 +34,11 @@ jobs: run: make clean-native native-all env: OCI_EXE: docker - - name: Upload native libraries - uses: actions/upload-artifact@v3 - with: - name: native-libs - path: src/main/resources/org/xerial/snappy/native/ - push: - name: Push new native libraries to branch - runs-on: ubuntu-latest - needs: [build] - steps: - - uses: actions/checkout@v3 - - name: Download native libraries - uses: actions/download-artifact@v3 - with: - name: native-libs - path: src/main/resources/org/xerial/snappy/native/ - - run: git status - - name: Commit and push - uses: EndBug/add-and-commit@v9 + - name: Create Pull Request + if: ${{ github.event_name != 'pull_request' }} + uses: peter-evans/create-pull-request@v5 with: - message: 'Update native libraries' - default_author: github_actions + title: Update native libraries + commit-message: Update native libraries for ${{ github.sha }} + branch: update-native-libs + labels: library-update diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbbeafc6..fd78a942 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,14 +7,19 @@ on: - '**.java' - '**.sbt' - '.github/workflows/*.yml' + - '**.so' + - '**.dll' + - 'src/main/resources/**' push: branches: - master + - main paths: - '**.scala' - '**.java' - '**.sbt' - '.github/workflows/*.yml' + - 'src/main/resources/org/xerial/snappy/**' jobs: code_format: diff --git a/Makefile b/Makefile index 41e5b062..486be7fb 100644 --- a/Makefile +++ b/Makefile @@ -209,6 +209,8 @@ win-armv7: jni-header win-aarch64: jni-header ./docker/dockcross-windows-arm64 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native native OS_NAME=Windows OS_ARCH=aarch64' + +# TODO: CROSS_PREFIX can be replaced with ${CROSS_ROOT}/bin/${CROSS_TRIPLE}- in Makefile.common linux-arm: jni-header ./docker/dockcross-armv5 -a $(DOCKER_RUN_OPTS) bash -c 'make clean-native native CROSS_PREFIX=/usr/xcc/armv5-unknown-linux-gnueabi/bin//armv5-unknown-linux-gnueabi- OS_NAME=Linux OS_ARCH=arm' diff --git a/Makefile.common b/Makefile.common index c296c0c1..8fe9ed0f 100755 --- a/Makefile.common +++ b/Makefile.common @@ -50,8 +50,8 @@ endif # os=Default is meant to be generic unix/linux +# To support new CPU architecture, add a new target name here known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armv6 Linux-armv7 Linux-android-arm Linux-android-aarch64 Linux-aarch64 Linux-ppc Linux-ppc64 Linux-ppc64le Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 Mac-aarch64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 Windows-armv7 Windows-aarch64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 Linux-riscv Linux-riscv64 - os_arch := $(OS_NAME)-$(OS_ARCH) IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7")) diff --git a/src/main/resources/org/xerial/snappy/native/Windows/x86/snappyjava.dll b/src/main/resources/org/xerial/snappy/native/Windows/x86/snappyjava.dll index 840d7d81..2076a640 100755 Binary files a/src/main/resources/org/xerial/snappy/native/Windows/x86/snappyjava.dll and b/src/main/resources/org/xerial/snappy/native/Windows/x86/snappyjava.dll differ diff --git a/src/main/resources/org/xerial/snappy/native/Windows/x86_64/snappyjava.dll b/src/main/resources/org/xerial/snappy/native/Windows/x86_64/snappyjava.dll index cb6c7703..6269de2d 100755 Binary files a/src/main/resources/org/xerial/snappy/native/Windows/x86_64/snappyjava.dll and b/src/main/resources/org/xerial/snappy/native/Windows/x86_64/snappyjava.dll differ