Skip to content

Commit

Permalink
Upgraded to Micronaut 3.8.1 (#5)
Browse files Browse the repository at this point in the history
* Upgraded to Micronaut 3.8.1

* Fixed native build

* Fixed native build

* Fixed native build

* Update native CI

* Fixed shadow jar name

* Fixed config native run

* Fixed config reading at native runtime

* Fix native runtime

* Improved format

* Disable ssl checks

* Removed deprecated set output

* Removed deprecated set output

* Disabled logs about trust all certs
  • Loading branch information
Loïc GREFFIER authored Jan 17, 2023
1 parent 2c5d576 commit 7a22d45
Show file tree
Hide file tree
Showing 39 changed files with 208 additions and 554 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ jobs:
restore-keys: ${{ runner.os }}-gradle

- name: Build and analyze
id: build_jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build jacocoTestReport sonarqube --info
run: |
./gradlew build jacocoTestReport sonarqube --info
echo current_version=$(echo $(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')) >> $GITHUB_OUTPUT
- name: Publish test report
if: always()
Expand All @@ -49,7 +52,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: kafkactl-jar
path: ${{ github.workspace }}/build/libs/kafkactl-*.jar
path: ${{ github.workspace }}/build/libs/kafkactl-${{ steps.build_jar.outputs.current_version }}.jar

build-linux:
runs-on: ubuntu-latest
Expand All @@ -62,7 +65,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '21.1.0'
version: '22.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -81,14 +84,17 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Native image
run: ./gradlew shadowJar nativeImage
- name: Build
id: build_native
run: |
./gradlew nativeCompile
echo current_version=$(echo $(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')) >> $GITHUB_OUTPUT
- name: Upload
uses: actions/upload-artifact@v3
with:
name: kafkactl-linux
path: ${{ github.workspace }}/build/native-image/kafkactl-*
path: ${{ github.workspace }}/build/native/nativeCompile/kafkactl-${{ steps.build_native.outputs.current_version }}

build-windows:
runs-on: windows-latest
Expand All @@ -101,7 +107,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '20.3.2'
version: '22.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -118,12 +124,12 @@ jobs:

- name: Build
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
gradlew.bat shadowJar nativeImage
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
gradlew.bat nativeCompile
shell: cmd

- name: Upload
uses: actions/upload-artifact@v3
with:
name: kafkactl-windows
path: ${{ github.workspace }}/build/native-image/kafkactl-*.exe
path: ${{ github.workspace }}/build/native/nativeCompile/kafkactl-*.exe
28 changes: 17 additions & 11 deletions .github/workflows/on_push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ jobs:
restore-keys: ${{ runner.os }}-gradle

- name: Build and analyze
id: build_jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build jacocoTestReport sonarqube --info
run: |
./gradlew build jacocoTestReport sonarqube --info
echo current_version=$(echo $(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')) >> $GITHUB_OUTPUT
- name: Publish test report
if: always()
Expand All @@ -58,7 +61,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: kafkactl-jar
path: ${{ github.workspace }}/build/libs/kafkactl-*.jar
path: ${{ github.workspace }}/build/libs/kafkactl-${{ steps.build_jar.outputs.current_version }}.jar

build-linux:
runs-on: ubuntu-latest
Expand All @@ -71,7 +74,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '21.1.0'
version: '22.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -90,27 +93,30 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Native image
run: ./gradlew shadowJar nativeImage
- name: Build
id: build_native
run: |
./gradlew nativeCompile
echo current_version=$(echo $(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')) >> $GITHUB_OUTPUT
- name: Upload
uses: actions/upload-artifact@v3
with:
name: kafkactl-linux
path: ${{ github.workspace }}/build/native-image/kafkactl-*
path: ${{ github.workspace }}/build/native/nativeCompile/kafkactl-${{ steps.build_native.outputs.current_version }}

build-windows:
runs-on: windows-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0

- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '20.3.2'
version: '22.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -127,12 +133,12 @@ jobs:

- name: Build
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
gradlew.bat shadowJar nativeImage
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
gradlew.bat nativeCompile
shell: cmd

- name: Upload
uses: actions/upload-artifact@v3
with:
name: kafkactl-windows
path: ${{ github.workspace }}/build/native-image/kafkactl-*.exe
path: ${{ github.workspace }}/build/native/nativeCompile/kafkactl-*.exe
49 changes: 16 additions & 33 deletions .github/workflows/on_push_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
restore-keys: ${{ runner.os }}-gradle

- name: Build and test
id: build_and_test
id: build_jar
run: |
./gradlew build check -Prelease
echo ::set-output name=current_version::$(echo $(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}'))
./gradlew build check
echo current_version=$(echo $(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')) >> $GITHUB_OUTPUT
- name: Publish test report
if: always()
Expand All @@ -45,15 +45,9 @@ jobs:
report_paths: '**/build/test-results/test/TEST-*.xml'

- name: Docker
run: ./gradlew dockerBuild dockerPush -Prelease
run: ./gradlew dockerBuild dockerPush

- name: Upload
uses: actions/upload-artifact@v3
with:
name: kafkactl-jar
path: ${{ github.workspace }}/build/libs/kafkactl-*.jar

- name: Generate Release Changelog
- name: Generate release changelog
uses: mikepenz/release-changelog-builder-action@v1
id: build_changelog
with:
Expand All @@ -66,7 +60,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.build_changelog.outputs.changelog }}
artifacts: ${{ github.workspace }}/cli/build/libs/kafkactl-*.jar
artifacts: ${{ github.workspace }}/cli/build/libs/kafkactl-${{ steps.build_jar.outputs.current_version }}.jar
draft: true
prerelease: true
allowUpdates: true
Expand All @@ -82,7 +76,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '21.1.0'
version: '22.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -95,20 +89,16 @@ jobs:
restore-keys: ${{ runner.os }}-gradle

- name: Build
run: ./gradlew shadowJar nativeImage -Prelease

- name: Upload
uses: actions/upload-artifact@v3
with:
name: kafkactl-linux
path: ${{ github.workspace }}/build/native-image/kafkactl-*
id: build_native
run: |
./gradlew nativeCompile
echo current_version=$(echo $(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')) >> $GITHUB_OUTPUT
- name: Update release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.build_changelog.outputs.changelog }}
artifacts: ${{ github.workspace }}/build/native-image/kafkactl-${{ steps.build_and_test.outputs.current_version }}
artifacts: ${{ github.workspace }}/build/native/nativeCompile/kafkactl-${{ steps.build_native.outputs.current_version }}
draft: true
prerelease: true
allowUpdates: true
Expand All @@ -125,7 +115,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '20.3.2'
version: '22.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -142,22 +132,15 @@ jobs:

- name: Build
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
gradlew.bat shadowJar nativeImage
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
gradlew.bat nativeCompile
shell: cmd

- name: Upload
uses: actions/upload-artifact@v3
with:
name: kafkactl-windows
path: ${{ github.workspace }}/build/native-image/kafkactl-*.exe

- name: Update release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.build_changelog.outputs.changelog }}
artifacts: ${{ github.workspace }}/cli/build/native-image/kafkactl-*.exe
artifacts: ${{ github.workspace }}/build/native/nativeCompile/kafkactl-*.exe
draft: true
prerelease: true
allowUpdates: true
35 changes: 0 additions & 35 deletions build-native.md

This file was deleted.

Loading

0 comments on commit 7a22d45

Please sign in to comment.