Skip to content

Commit 855998f

Browse files
authored
Merge pull request #15 from Razdeep/ci-tag
- PaymentEntry Supplier not disabling upon selection - Github release pipeline added - ShadowJar functionality added - `./gradlew jar` deprecated
2 parents e5257ba + 2e61511 commit 855998f

File tree

11 files changed

+77
-28
lines changed

11 files changed

+77
-28
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,31 @@ name: JavaFX Build (Gradle)
22

33
on:
44
push:
5-
branches: [ main, modern ]
65
pull_request:
7-
branches: [ main, modern ]
86

97
jobs:
108
build:
119
runs-on: ubuntu-latest
1210

1311
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v3
12+
- name: Checkout code
13+
uses: actions/checkout@v4
1614

1715
- name: Set up JDK
18-
uses: actions/setup-java@v3
16+
uses: actions/setup-java@v4
1917
with:
20-
distribution: 'temurin'
21-
java-version: '17'
18+
distribution: temurin
19+
java-version: 17
20+
cache: gradle
2221

23-
- name: Cache Gradle dependencies
24-
uses: actions/cache@v3
25-
with:
26-
path: |
27-
~/.gradle/caches
28-
~/.gradle/wrapper
29-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
30-
restore-keys: |
31-
${{ runner.os }}-gradle-
32-
33-
- name: Grant execute permission for Gradle wrapper
34-
run: chmod +x ./gradlew
22+
- name: Make Gradle executable
23+
run: chmod +x gradlew
3524

3625
- name: Build using Gradle
3726
run: ./gradlew clean build --exclude-task spotlessCheck
3827

3928
- name: Upload JAR artifact
4029
uses: actions/upload-artifact@v4
4130
with:
42-
name: javafx-app
43-
path: build/libs/*.jar
31+
name: satyam-consignment
32+
path: build/libs/*

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release JAR
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: temurin
23+
java-version: 17
24+
cache: gradle
25+
26+
- name: Make Gradle executable
27+
run: chmod +x gradlew
28+
29+
- name: Build JAR
30+
run: ./gradlew clean shadowJar
31+
32+
- name: Create GitHub Release and upload JAR
33+
uses: softprops/action-gh-release@v2
34+
with:
35+
files: |
36+
build/libs/*
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id 'java'
44
id "org.openjfx.javafxplugin" version "0.1.0"
55
id 'com.diffplug.spotless' version '7.0.2'
6+
id "com.github.johnrengelman.shadow" version "7.1.2"
67
}
78

89
repositories {
@@ -66,10 +67,14 @@ jar {
6667
}
6768
}
6869

70+
shadowJar {
71+
archiveClassifier.set("")
72+
}
73+
6974
def dependencyDirectory = layout.buildDirectory.dir("libs/lib")
7075

7176
tasks.register('copyDatabase', Copy) {
72-
from('example') {
77+
from('data') {
7378
include 'database.db'
7479
}
7580
into "${layout.buildDirectory.get()}/libs"
@@ -78,6 +83,18 @@ tasks.register('copyDatabase', Copy) {
7883
}
7984
}
8085

86+
tasks.register('copyScripts', Copy) {
87+
from('scripts') {
88+
include 'start.sh'
89+
include 'start.bat'
90+
}
91+
into "${layout.buildDirectory.get()}/libs"
92+
doLast {
93+
println "Copied scripts to build directory"
94+
}
95+
}
96+
97+
8198
tasks.register('copyRuntimeDeps', Copy) {
8299
from(configurations.runtimeClasspath)
83100
into(dependencyDirectory)
@@ -96,8 +113,16 @@ tasks.register('copyDeps', Copy) {
96113

97114
tasks.named('jar') {
98115
dependsOn (
116+
tasks.named('copyScripts'),
99117
tasks.named('copyDatabase'),
100118
tasks.named('copyDeps'),
101119
tasks.named('copyRuntimeDeps')
102120
)
103121
}
122+
123+
tasks.named('shadowJar') {
124+
dependsOn (
125+
tasks.named('copyScripts'),
126+
tasks.named('copyDatabase'),
127+
)
128+
}
File renamed without changes.
File renamed without changes.

database.db

-22 KB
Binary file not shown.

makeDatabase.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

makeDatabase.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
#!/usr/bin/bash
22

33
RED='\033[0;31m'
4-
NC='\033[0m'
54

65
if [[ -z "$PATH_TO_FX" ]]; then
76
echo -e "${RED}Please set the environment variable PATH_TO_FX and rerun."
87
exit 1
98
fi
109

11-
java --module-path $PATH_TO_FX \
10+
java --module-path "$PATH_TO_FX" \
1211
--add-modules javafx.controls,javafx.base,javafx.graphics,javafx.fxml \
1312
--add-exports javafx.base/com.sun.javafx.event=ALL-UNNAMED \
1413
--add-exports javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED \
1514
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED \
1615
--add-exports javafx.base/com.sun.javafx.binding=ALL-UNNAMED \
1716
--add-exports javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED \
18-
-jar build/libs/SatyamConsignment.jar
17+
-jar SatyamConsignment.jar

0 commit comments

Comments
 (0)