Update dependencies (#43) #157
This file contains hidden or 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: CI/CD | |
| on: | |
| # Push on main and release tags | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| # PR | |
| pull_request: | |
| branches: | |
| - 'main' | |
| # Manual trigger | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: CI/CD | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up JDK 21 and gradle cache | |
| id: java | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| cache: 'gradle' | |
| - name: Check if main repo | |
| id: is_main_repo | |
| run: | | |
| if [ $GITHUB_REPOSITORY == 'openremote/extensions' ]; then | |
| echo "value=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Run build | |
| if: ${{ !steps.is_main_repo.outputs.value || github.event_name == 'pull_request' }} | |
| run: | | |
| ./gradlew build | |
| timeout-minutes: 20 | |
| - name: Run build and publish | |
| if: ${{ steps.is_main_repo.outputs.value && github.event_name != 'pull_request' }} | |
| run: | | |
| echo "$KEYSTORE_BASE64" | base64 -d > keystore | |
| ./gradlew build publishToSonatype closeAndReleaseSonatypeStagingRepository \ | |
| -PsigningKey=$MAVEN_SIGNING_KEY -PsigningPassword=$MAVEN_SIGNING_PASSWORD -PpublishUsername=$MAVEN_USERNAME -PpublishPassword=$MAVEN_PASSWORD \ | |
| -PkeystoreKeyAlias=$KEYSTORE_KEY_ALIAS -PkeystoreKeyPassword=$KEYSTORE_KEY_PASSWORD -PkeystoreFile=$PWD/keystore -PkeystorePassword=$KEYSTORE_PASSWORD | |
| env: | |
| MAVEN_SIGNING_KEY: ${{ secrets._TEMP_MAVEN_SIGNING_KEY || secrets.MAVEN_SIGNING_KEY }} | |
| MAVEN_SIGNING_PASSWORD: ${{ secrets._TEMP_MAVEN_SIGNING_PASSWORD || secrets.MAVEN_SIGNING_PASSWORD }} | |
| MAVEN_USERNAME: ${{ secrets._TEMP_MAVEN_USERNAME || secrets.MAVEN_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets._TEMP_MAVEN_PASSWORD || secrets.MAVEN_PASSWORD }} | |
| KEYSTORE_BASE64: | | |
| ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
| KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| KEYSTORE_KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }} | |
| KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} | |
| timeout-minutes: 20 | |
| - name: Archive backend test results | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: backend-test-results | |
| path: test/build/reports/tests | |
| - name: Archive coverage report | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: coverage-report | |
| path: test/build/reports/jacoco/test/html |