Skip to content

add: cd

add: cd #9

name: deploy maven central
on:
push:
workflow_dispatch:
jobs:
test:
if: github.ref != 'refs/heads/main'
uses: ./.github/workflows/test.yml
cd:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Publish package
uses: gradle/gradle-build-action@v2
with:
arguments: |
-PmavenCentralUsername=${{ secrets.MAVEN_USERNAME }}
-PmavenCentralPassword=${{ secrets.MAVEN_PASSWORD }}
-PsigningInMemoryKeyId=${{ secrets.MAVEN_GPG_KEY_ID }}
-PsigningInMemoryPassword=${{ secrets.MAVEN_GPG_PASSPHRASE }}
publishKotlinMultiplatformPublicationToMavenCentralRepository
#####