upgrade to gradle-8.10.2 #10
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: Build and Publish for all Platforms | |
on: [push] | |
env: | |
SWIG_VERSION: 4.0.2 | |
jobs: | |
validate-gradle-wrapper: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v2 | |
swig: | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-12, macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: SWIG from cache | |
id: cache-swig | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/swig | |
key: ${{ runner.os }}-${{ runner.arch }}-swig-${{ env.SWIG_VERSION }} | |
- name: Install SWIG build dependencies | |
if: steps.cache-swig.outputs.cache-hit != 'true' | |
run: | | |
if [ "${{ runner.os }}" == 'Linux' ]; then | |
sudo apt-get install -y autoconf automake libtool | |
elif [ "${{ runner.os }}" == 'macOS' ]; then | |
brew install autoconf automake libtool pcre | |
else | |
echo "Unsupported OS: ${{ runner.os }}" | |
exit 1 | |
fi | |
- name: Build SWIG v${{ env.SWIG_VERSION }} | |
if: steps.cache-swig.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/swig/swig/archive/refs/tags/v${{ env.SWIG_VERSION }}.tar.gz | |
tar xzf v${{ env.SWIG_VERSION }}.tar.gz | |
cd swig-${{ env.SWIG_VERSION }} | |
./autogen.sh | |
./configure --prefix=$GITHUB_WORKSPACE/swig | |
make | |
make install | |
- name: Install SWIG runtime dependencies | |
if: runner.os == 'macOs' | |
run: | | |
brew install pcre | |
- name: Check SWIG version | |
run: $GITHUB_WORKSPACE/swig/bin/swig -version | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-12, macos-14] | |
runs-on: ${{ matrix.os }} | |
needs: [validate-gradle-wrapper, swig] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Restore SWIG from cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/swig | |
key: ${{ runner.os }}-${{ runner.arch }}-swig-${{ env.SWIG_VERSION }} | |
fail-on-cache-miss: true | |
- name: Add SWIG to $PATH | |
run: echo "${{ github.workspace }}/swig/bin" >> $GITHUB_PATH | |
- name: Install MinGW-w64 | |
if: runner.os == 'Linux' | |
run: sudo apt-get install -y mingw-w64 | |
- name: Install pcre | |
if: runner.os == 'macOS' | |
run: brew install pcre | |
- name: Check SWIG version | |
run: swig -version | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build | |
run: ./gradlew build buildNatives | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-${{ runner.arch }}-artifacts | |
path: | | |
build/natives/*/*.so | |
build/natives/*/*.dll | |
build/natives/*/*.dylib | |
publish: | |
runs-on: ubuntu-20.04 | |
needs: [validate-gradle-wrapper, swig, build] | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Restore SWIG from cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/swig | |
key: ${{ runner.os }}-${{ runner.arch }}-swig-${{ env.SWIG_VERSION }} | |
fail-on-cache-miss: true | |
- name: Add SWIG to $PATH | |
run: echo "${{ github.workspace }}/swig/bin" >> $GITHUB_PATH | |
- name: Check SWIG version | |
run: swig -version | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: build/natives | |
merge-multiple: true | |
- name: Build and Zip Natives | |
run: ./gradlew build zipNatives | |
- name: Publish | |
run: ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true publish -PmavenUser=${artifactoryUser} -PmavenPass=${artifactoryPass} | |
env: | |
artifactoryUser: ${{ secrets.ARTIFACTORY_USER }} | |
artifactoryPass: ${{ secrets.ARTIFACTORY_PASS }} |