Merge pull request #473 from kennethshackleton/prepare-0.20.0 #397
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: 'Publication' | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
publish: | |
name: 'Publish' | |
runs-on: ubuntu-latest | |
timeout-minutes: 120 | |
steps: | |
- name: 'Install system packages' | |
run: sudo apt-get install -y --no-install-recommends clang gcc make sed tcl | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: 'Gradle' | |
run: | | |
echo 'org.gradle.caching=false' >> gradle.properties | |
echo 'org.gradle.configuration-cache=false' >> gradle.properties | |
- name: 'Unit tests' | |
run: ./gradlew :selekt-android:testDebugUnitTest :selekt-java:test | |
- name: 'Build Selekt' | |
run: | | |
./gradlew clean \ | |
:OpenSSL:assembleArm64-v8a \ | |
:OpenSSL:assembleArmeabi-v7a \ | |
:OpenSSL:assembleX86 \ | |
:OpenSSL:assembleX86_64 | |
./gradlew :selekt-sqlite3:amalgamate | |
./gradlew assembleRelease | |
- name: 'Publish snapshot to OSSRH' | |
if: github.event_name == 'push' | |
env: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} | |
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSPHRASE }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} | |
run: | | |
./gradlew \ | |
-Prelease=false \ | |
publishMainPublicationToSonatypeRepository \ | |
closeSonatypeStagingRepository | |
- name: 'Publish release to OSSRH' | |
if: github.event_name == 'release' && github.event.action == 'published' | |
env: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} | |
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSPHRASE }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} | |
run: | | |
./gradlew \ | |
-Prelease=true \ | |
publishMainPublicationToSonatypeRepository \ | |
closeAndReleaseSonatypeStagingRepository |