1.0.0 release #570
Workflow file for this run
This file contains 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: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- 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@v4 | |
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@v4 | |
- name: Setup JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- 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: Assert versions | |
run: | | |
[ "${{ steps.tag.outputs.tag }}" == "$(./get-version.sh)" ] || (echo "version in gradle.properties does not match tag"; exit 1) | |
- 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@v2 | |
- name: Login to docker hub | |
uses: docker/login-action@v3 | |
with: | |
username: enonicpublisher | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build java-client and java-operator | |
run: ./gradlew build | |
- 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,linux/ppc64le,linux/s390x,linux/arm/v7 | |
- name: Publish helm chart | |
run: curl -u "ci:${{ secrets.ARTIFACTORY_PASSWORD }}" https://repo.enonic.com/repository/helm/ --upload-file helm/build/libs/xp-operator-$(./get-version.sh).tgz -v | |
- name: Publish java-client | |
run: ./gradlew publish -PrepoUser=ci -PrepoPassword=${{ secrets.ARTIFACTORY_PASSWORD }} |