Merge pull request #561 from kizitonwose/multiplatform #135
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: Publish Snapshot | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
# Use macOS so iOS artifacts are published | |
publish-snapshot: | |
name: Publish Snapshot | |
runs-on: macos-latest | |
if: github.repository == 'kizitonwose/Calendar' | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Cache Gradle | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches/ | |
~/.gradle/wrapper/ | |
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }} | |
restore-keys: cache-gradle- | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Retrieve Version | |
run: | | |
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV | |
- name: Publish Snapshot to Maven | |
run: ./gradlew publish | |
# if: endsWith(env.VERSION_NAME, '-SNAPSHOT') | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} |