Skip to content

Commit

Permalink
upgrade to Micronaut 3.7.4 (#58)
Browse files Browse the repository at this point in the history
* upgrade to Micronaut 3.7.3

* Upgrading GraalVM used for compilation

* Micronaut 3.7.4

* removed java-library from cli app project

* removed manual caching

* Setup GraalVM JDK

* using nativeCompile

* native distribution task, renamed legacy build

* fixed macOs packaging

* building archive using Gradle

* include version in the archive name, redone release workflow

* reordered to preserve present directory

* using the correct task to build the archives
  • Loading branch information
musketyr authored Dec 1, 2022
1 parent 4f9e85c commit ea54952
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 94 deletions.
43 changes: 4 additions & 39 deletions .github/workflows/graalvm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,53 +23,18 @@ jobs:
- name: Semantic Version
id: version
uses: ncipollo/semantic-version-action@v1
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
key: ${{ runner.os }}-gradle-test-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-test-
- name: 'Add Developer Command Prompt for Microsoft Visual C++ '
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Setup GraalVM CE
uses: DeLaGuardo/setup-graalvm@3.1
with:
graalvm-version: 21.2.0.java11
graalvm-version: 22.3.0.java11
- name: Install Native Image
run: ${{ matrix.gu-binary }} install native-image
- name: Build Native Image Snapshot
run: |
./gradlew :guide:html2text --no-daemon -Pversion="${{ steps.version.outputs.tag }}" -Prelease=true
./gradlew :pierrot:buildLayers --no-daemon -Pversion="${{ steps.version.outputs.tag }}" -Prelease=true
./gradlew :pierrot:shadowJar --no-daemon -Pversion="${{ steps.version.outputs.tag }}" -Prelease=true
native-image --no-fallback -H:ConfigurationFileDirectories=apps/pierrot/build/docker/layers/resources -cp apps/pierrot/build/libs/pierrot-*-all.jar -H:Class=com.agorapulse.pierrot.cli.PierrotCommand -H:Name=pierrot --trace-object-instantiation=java.io.FileDescriptor
- name: Windows Archive
if: ${{ runner.os == 'Windows' }}
run: |
New-Item "./pierrot-win-amd64-v${{ steps.version.outputs.tag }}/bin" -ItemType Directory -ea 0
Move-Item -Path ./pierrot.exe -Destination "./pierrot-win-amd64-v${{ steps.version.outputs.tag }}/bin"
Copy-Item "./LICENSE" -Destination "./pierrot-win-amd64-v${{ steps.version.outputs.tag }}"
Copy-Item "./docs/guide/build/html2text/README" -Destination "./pierrot-win-amd64-v${{ steps.version.outputs.tag }}/README"
Compress-Archive -Path "./pierrot-win-amd64-v${{ steps.version.outputs.tag }}" -Update -DestinationPath ./pierrot-win-amd64-v${{ steps.version.outputs.tag }}.zip
- name: macOS Archive
if: ${{ runner.os == 'macOS' }}
run: |
mkdir -p pierrot-darwin-amd64-v${{ steps.version.outputs.tag }}/bin
mv ./pierrot pierrot-darwin-amd64-v${{ steps.version.outputs.tag }}/bin
cp ./LICENSE pierrot-darwin-amd64-v${{ steps.version.outputs.tag }}/
cp ./docs/guide/build/html2text/README pierrot-darwin-amd64-v${{ steps.version.outputs.tag }}/README
zip -r pierrot-darwin-amd64-v${{ steps.version.outputs.tag }}.zip ./pierrot-darwin-amd64-v${{ steps.version.outputs.tag }} -x '*.DS_Store*' -x '__MAC_OSX'
- name: Linux Archive
if: ${{ runner.os == 'Linux' }}
run: |
mkdir -p pierrot-linux-amd64-v${{ steps.version.outputs.tag }}/bin
mv ./pierrot pierrot-linux-amd64-v${{ steps.version.outputs.tag }}/bin
cp ./LICENSE pierrot-linux-amd64-v${{ steps.version.outputs.tag }}/
cp ./docs/guide/build/html2text/README pierrot-linux-amd64-v${{ steps.version.outputs.tag }}/README
zip -r pierrot-linux-amd64-v${{ steps.version.outputs.tag }}.zip ./pierrot-linux-amd64-v${{ steps.version.outputs.tag }}
- uses: gradle/gradle-command-action@v2
with:
arguments: :pierrot:nativeDistZip
- uses: actions/upload-artifact@v2
with:
name: pierrot-${{ matrix.os }}
Expand Down
54 changes: 10 additions & 44 deletions .github/workflows/graalvm-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,29 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
key: ${{ runner.os }}-gradle-test-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-test-
- name: 'Add Developer Command Prompt for Microsoft Visual C++ '
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Setup GraalVM CE
uses: DeLaGuardo/setup-graalvm@3.1
with:
graalvm-version: 21.2.0.java11
graalvm-version: 22.3.0.java11
- name: Install Native Image
run: ${{ matrix.gu-binary }} install native-image
- name: Build Native Image Snapshot
run: |
./gradlew :guide:html2text
./gradlew :pierrot:buildLayers --no-daemon
./gradlew :pierrot:shadowJar --no-daemon
native-image --no-fallback -H:ConfigurationFileDirectories=apps/pierrot/build/docker/layers/resources -cp apps/pierrot/build/libs/pierrot-*-all.jar -H:Class=com.agorapulse.pierrot.cli.PierrotCommand -H:Name=pierrot --trace-object-instantiation=java.io.FileDescriptor
- uses: gradle/gradle-command-action@v2
with:
arguments: :pierrot:nativeDistZip
- uses: actions/upload-artifact@v2
with:
name: pierrot-${{ matrix.os }}.zip
path: apps/pierrot/build/distributions/pierrot-*.zip
- name: Verify Binary
if: ${{ runner.os == 'Linux' || runner.os == 'macOS'}}
env:
GITHUB_TOKEN: ${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }}
GITHUB_ORG: agorapulse
run: |
cd apps/pierrot/build/native/nativeCompile
./pierrot search repo:agorapulse/pierrot filename:.testfile
./pierrot status repo:agorapulse/pierrot author:musketyr
./pierrot init -b chore/testbranch -t "Test Title" -m "Test Message" --project "Test Project" --workspace testws
Expand All @@ -65,34 +59,6 @@ jobs:
grep -q project pierrot.yml
cd ..
./pierrot push --workspace testws
- name: Windows Archive
if: ${{ runner.os == 'Windows' }}
run: |
New-Item "./pierrot-win-amd64/bin" -ItemType Directory -ea 0
Move-Item -Path ./pierrot.exe -Destination "./pierrot-win-amd64/bin"
Copy-Item "./LICENSE" -Destination "./pierrot-win-amd64"
Copy-Item "./docs/guide/build/html2text/README" -Destination "./pierrot-win-amd64/README"
Compress-Archive -Path "./pierrot-win-amd64" -Update -DestinationPath ./pierrot-win-amd64.zip
- name: macOS Archive
if: ${{ runner.os == 'macOS' }}
run: |
mkdir -p pierrot-darwin-amd64/bin
mv ./pierrot pierrot-darwin-amd64/bin
cp ./LICENSE pierrot-darwin-amd64/
cp ./docs/guide/build/html2text/README pierrot-darwin-amd64/README
zip -r pierrot-darwin-amd64.zip ./pierrot-darwin-amd64 -x '*.DS_Store*' -x '__MAC_OSX'
- name: Linux Archive
if: ${{ runner.os == 'Linux' }}
run: |
mkdir -p pierrot-linux-amd64/bin
mv ./pierrot pierrot-linux-amd64/bin
cp ./LICENSE pierrot-linux-amd64/
cp ./docs/guide/build/html2text/README pierrot-linux-amd64/README
zip -r pierrot-linux-amd64.zip ./pierrot-linux-amd64
- uses: actions/upload-artifact@v2
with:
name: pierrot-${{ matrix.os }}.zip
path: pierrot-*.zip
- name: Docker login (master and Linux only)
if: github.ref == 'refs/heads/master' && runner.os == 'Linux'
uses: docker/login-action@v1
Expand All @@ -107,4 +73,4 @@ jobs:
DOCKER_REGISTRY_URL: ${{ secrets.DOCKER_REGISTRY_URL }}
run: |
export DOCKER_IMAGE=`echo "${DOCKER_REGISTRY_URL}/${DOCKER_REPOSITORY_PATH}/pierrot" | sed -e 's#//#/#' -e 's#^/##'`
./gradlew :pierrot:dockerPushNative --no-daemon
./gradlew :pierrot:dockerPushNative
2 changes: 1 addition & 1 deletion .github/workflows/gradle-versions-watchdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
java-version: 11
- uses: gradle/gradle-command-action@v2
with:
arguments: check --stacktrace
arguments: check -x :pierrot:testNativeImage --stacktrace
gradle-version: rc
11 changes: 5 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11

- uses: actions/cache@v1
- name: Setup GraalVM CE
uses: DeLaGuardo/setup-graalvm@3.1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
graalvm-version: 22.3.0.java11
- name: Install Native Image
run: gu install native-image
- uses: gradle/gradle-command-action@v2
with:
arguments: check coveralls --stacktrace
Expand Down
32 changes: 32 additions & 0 deletions apps/pierrot/pierrot.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.gradle.internal.os.OperatingSystem

plugins {
id 'io.sdkman.vendors' version '3.0.0'
}
Expand Down Expand Up @@ -57,6 +59,36 @@ dockerBuild {
images = ["${System.env.DOCKER_IMAGE ?: project.name}:$project.version"]
}


String filename = 'pierrot-'
OperatingSystem os = OperatingSystem.current()

if (os.linux) {
filename += 'linux'
} else if (os.macOsX) {
filename += 'darwin'
} else if (os.windows) {
filename += 'win'
}

filename += "-amd64-v$version"

distributions {
register("native") {
contents {
into (filename) {
from(tasks.named("nativeCompile"))
from(project(':guide').tasks.named('html2text'))
from(rootProject.file('LICENSE'))
}
}
}
}

nativeDistZip {
archiveFileName.set(filename + '.zip')
}

dockerBuildNative {
images = [
"${System.env.DOCKER_IMAGE ?: project.name}:$project.version",
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ gradleProjects {
}

dependencies {
api platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
implementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
compileOnly platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
testImplementation platform("org.codehaus.groovy:groovy-bom:$groovyVersion")
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ nexusPluginVersion=1.0.0

groovyVersion=3.0.9
spockVersion=2.0-groovy-3.0
micronautVersion=3.1.1
micronautPluginVersion=2.0.6
micronautVersion=3.7.4
micronautPluginVersion=3.6.5
shadowPluginVersion=7.1.0
githubApiVersion=1.133

1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ projects {
dir('apps') {
plugins {
id 'groovy'
id 'java-library'
id 'com.github.johnrengelman.shadow'
id 'io.micronaut.application'
}
Expand Down

0 comments on commit ea54952

Please sign in to comment.