Skip to content

Commit

Permalink
Remove GraalVM, use jpackage and generate .zip (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
garcanam authored Jan 20, 2025
1 parent 0a83847 commit e0409f5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,20 @@ jobs:
- name: Grant execute permission for gradlew
run: cd client && chmod +x gradlew
- name: Build
run: cd client && ./gradlew build
run: cd client && ./gradlew clean build
- name: Test
run: cd client && ./gradlew test
- name: Package
run: cd client && ./gradlew bootJar
- name: Build toscactl-linux-amd64
run: cd client && make build_linux VERSION=${{ needs.precheck.outputs.version }} COMMIT=$(git rev-parse HEAD)
- name: List build directory
- name: Package Application
run: |
ls -la client/build/
ls -la client/build/libs/
- name: Archive JAR
uses: actions/upload-artifact@v4
with:
name: app-${{ needs.precheck.outputs.full_version }}
path: |
client/build/libs/*.jar
client/build/*.jar
cd client
jpackage --input docker/ --name toscactl --main-jar app.jar --main-class org.springframework.boot.loader.JarLauncher --java-options "--enable-preview" --type app-image --verbose
zip -r toscactl.zip toscactl
- name: Release Asset Upload
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release' || github.event_name == 'prerelease'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: client/build/*.jar
file: client/toscactl.zip
tag: ${{ needs.precheck.outputs.branchTag }}
overwrite: true
file_glob: true
13 changes: 7 additions & 6 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ VERSION=v0.1
COMMIT=`git rev-parse --short=4 HEAD`
BUILD_TIME=`date +"%m/%d/%Y %H:%M:%S"`

build: get build_jar build_linux
build: get build_jar package

build_jar: build_prepare
cd $(ROOT_DIR)
./gradlew build

build_linux: build_prepare
cd $(ROOT_DIR) && ./gradlew bootJar
cp $(ROOT_DIR)/build/libs/*.jar $(BUILD_DIR)/toscactl-linux-amd64.jar

test:
cd $(ROOT_DIR)
./gradlew test
Expand All @@ -30,4 +26,9 @@ get:
./gradlew dependencies

build_prepare:
mkdir -p "$(BUILD_DIR)"
mkdir -p "$(BUILD_DIR)"

package:
cd $(ROOT_DIR)/client
jpackage --input docker/ --name toscactl --main-jar app.jar --main-class org.springframework.boot.loader.JarLauncher --java-options "--enable-preview" --type app-image
zip -r toscactl.zip toscactl
16 changes: 8 additions & 8 deletions client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ buildscript {
plugins {
id 'jacoco'
id 'maven-publish'
id 'java'
id 'org.springframework.boot' version '2.7.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'org.springframework.boot' version '2.7.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}

group = 'edptoscaqs'
Expand All @@ -23,14 +23,14 @@ repositories {
ext['log4j2.version'] = '2.17.0'

ext {
set('snippetsDir', file("build/generated-snippets"))
set('snippetsDir', file("build/generated-snippets"))
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'javax.validation:validation-api:2.0.1.Final'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'org.hibernate.validator:hibernate-validator:7.0.1.Final'
Expand Down

0 comments on commit e0409f5

Please sign in to comment.