diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab1100547..1a7a87163 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -203,3 +203,32 @@ jobs: with: name: .nyx-state-${{ github.job }}.json path: build/nyx-state.json + + publish_artifacts: + name: Publish artifacts + runs-on: ubuntu-latest + needs: [ build_apk, unit_test_debug, test_tooling_api ] + if: ${{ always() && github.event_name != 'pull_request' && needs.build_apk.result == 'success' && needs.unit_test_debug.result == 'success' && needs.test_tooling_api.result == 'success' }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Change Gradle wrapper permissions + run: chmod +x ./gradlew + - name: Restore cache + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Publish release + run: ./gradlew publishAllPublicationsToMavenCentralRepository --stacktrace \ No newline at end of file