diff --git a/.github/workflows/publish.yml b/.github/workflows/build-test-publish.yml similarity index 100% rename from .github/workflows/publish.yml rename to .github/workflows/build-test-publish.yml diff --git a/.github/workflows/publish-android-maven-central.yml b/.github/workflows/publish-android-maven-central.yml new file mode 100644 index 0000000..58c4290 --- /dev/null +++ b/.github/workflows/publish-android-maven-central.yml @@ -0,0 +1,39 @@ +name: Publish android to Maven Central + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Java + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + + - name: Set up permissions client + run: chmod +x ./src/AndroidClient/gradlew + + - name: Build android + working-directory: ./src/AndroidClient + run: ./gradlew android:build + + - name: Publish to Maven Central + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + working-directory: ./src/AndroidClient + run: ./gradlew android:publishAllPublicationsToOSSRHRepository diff --git a/.github/workflows/publish-client-maven-central.yml b/.github/workflows/publish-client-maven-central.yml new file mode 100644 index 0000000..416ac00 --- /dev/null +++ b/.github/workflows/publish-client-maven-central.yml @@ -0,0 +1,39 @@ +name: Publish client to Maven Central + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Java + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + + - name: Set up permissions client + run: chmod +x ./src/AndroidClient/gradlew + + - name: Build client + working-directory: ./src/AndroidClient + run: ./gradlew client:build + + - name: Publish to Maven Central + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + working-directory: ./src/AndroidClient + run: ./gradlew client:publishAllPublicationsToOSSRHRepository