release 1.1.2 #680
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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - v* | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Setup Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: '3.12.3' | |
| - name: Build and Publish | |
| run: | | |
| if [[ "$(./get-version.sh)" == *"-SNAPSHOT" ]] | |
| then | |
| echo "Building and publishing snapshot version" | |
| ./gradlew ci publish -PrepoUser=ci -PrepoPassword=${{ secrets.ARTIFACTORY_PASSWORD }} | |
| else | |
| echo "Building release version" | |
| ./gradlew build | |
| fi | |
| - name: Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Setup Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: '3.11.0' | |
| - name: Setup YQ | |
| uses: chrisdickinson/setup-yq@latest | |
| with: | |
| yq-version: v4.25.1 | |
| - name: Get tag | |
| id: tag | |
| uses: dawidd6/action-get-tag@v1 | |
| with: | |
| strip_v: true | |
| - name: Setup QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| image: tonistiigi/binfmt:qemu-v6.1.0-20 | |
| platforms: all | |
| - name: Setup buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to docker hub to publish image | |
| uses: docker/login-action@v3 | |
| with: | |
| username: enonicpublisher | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Operator version | |
| id: operator_version | |
| run: echo "version=$(./get-version.sh)" >> $GITHUB_OUTPUT | |
| - name: Assert versions | |
| run: | | |
| [ "${{ steps.tag.outputs.tag }}" == "${{ steps.operator_version.outputs.version }}" ] || (echo "version in gradle.properties does not match tag"; exit 1) | |
| - name: Build java-client and java-operator | |
| run: ./gradlew build -x check | |
| - name: Publish docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| pull: true | |
| no-cache: true | |
| push: true | |
| tags: "enonic/xp-operator:${{ steps.tag.outputs.tag }}" | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Publish helm chart | |
| run: curl -u "ci:${{ secrets.ARTIFACTORY_PASSWORD }}" https://repo.enonic.com/helm/ --upload-file helm/build/libs/xp-operator-${{ steps.operator_version.outputs.version }}.tgz -v | |
| - name: Publish java-client | |
| run: ./gradlew publish -PrepoUser=ci -PrepoPassword=${{ secrets.ARTIFACTORY_PASSWORD }} |