Merge pull request #82 from Doist/renovate/gradle-8.x #373
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: Test and publish | |
on: | |
push: | |
branches: [ main ] | |
tags: [ v* ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
targets: native,common | |
- os: macos-latest | |
targets: native | |
- os: windows-latest | |
targets: native | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- run: | | |
# azure.archive.ubuntu.com is flaky | |
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install -y libunistring-dev libc6-dev-i386 | |
if: runner.os == 'Linux' | |
- run: ./gradlew assemble check | |
env: | |
ORG_GRADLE_PROJECT_targets: ${{ matrix.targets }} | |
shell: bash | |
publish: | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
targets: all | |
publishRootTarget: true | |
- os: macos-latest | |
targets: native | |
publishRootTarget: false | |
- os: windows-latest | |
targets: native | |
publishRootTarget: false | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- id: get_tag_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
shell: bash | |
- run: sudo apt-get install -y libunistring-dev libc6-dev-i386 | |
if: runner.os == 'Linux' | |
- run: ./gradlew assemble | |
shell: bash | |
- run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | |
env: | |
ORG_GRADLE_PROJECT_version: ${{ steps.get_tag_version.outputs.VERSION }} | |
ORG_GRADLE_PROJECT_targets: ${{ matrix.targets }} | |
ORG_GRADLE_PROJECT_publishRootTarget: ${{ matrix.publishRootTarget }} | |
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_SECRET_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | |
shell: bash | |
release: | |
needs: publish | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} |