Trigger native lib build on PR (#444)
* trigger build native on PR and push Signed-off-by: Sudip Roy <sudiproy1999@gmail.com> * Add branch master * Trigger native lib build only for PRs * Test native lib build trigger * Targetting the PR repo * Add comment to trigger native lib build * Fix syntax error * Test with write permission * Test with contents: write * Test * test * Use gh pr checkout * fix * Add checkout phase * test target repo: * Try bot user * clanup * Use PAT * Use different user * simplify * fix * test * Fix token * revert * Try push action * use the same token * fix tab * Set ref * Create a new PR for every master update * fix * fix indent * Use native-all --------- Signed-off-by: Sudip Roy <sudiproy1999@gmail.com> Co-authored-by: Taro L. Saito <leo@xerial.org>
This commit is contained in:
parent
d8c5b8e4b6
commit
10f3b32d49
|
@ -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
|
||||
- name: Create Pull Request
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
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
|
||||
with:
|
||||
message: 'Update native libraries'
|
||||
default_author: github_actions
|
||||
title: Update native libraries
|
||||
commit-message: Updatge native libraries for ${{ github.sha }}
|
||||
branch: update-native-libs
|
||||
labels: library-update
|
||||
|
|
2
Makefile
2
Makefile
|
@ -203,6 +203,8 @@ freebsd64:
|
|||
# For ARM
|
||||
native-arm: linux-arm64 linux-android-arm linux-android-aarch64 linux-arm linux-armv6 linux-armv7
|
||||
|
||||
|
||||
# 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'
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ 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 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"))
|
||||
|
|
Loading…
Reference in New Issue