Skip to content

Commit

Permalink
Merge pull request #40 from samypr100/ci-integration
Browse files Browse the repository at this point in the history
Adding GHA CI Support
  • Loading branch information
Birdasaur committed Sep 10, 2023
2 parents e8ad544 + 455aa41 commit 2dc7be7
Show file tree
Hide file tree
Showing 16 changed files with 366 additions and 166 deletions.
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

# Sane defaults
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Java files
[*.java]
tab_width = 4
indent_size = 4
indent_style = space

# XML files
[*.{xml,fxml}]
tab_width = 4
indent_size = 4
indent_style = space

[*.css]
tab_width = 4
indent_size = 4
indent_style = space

# MD Files
[*.md]
ij_formatter_enabled = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=crlf
100 changes: 100 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Build and Deploy

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
release:
types: [ "published" ]

permissions:
contents: write
packages: write

# cancel in progress jobs or runs for the current workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:

build-jar:

name: jar / ${{ matrix.os }} / ${{ matrix.jdk-version }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
jdk-version: [ 17 ]
os: [ ubuntu-latest, macos-latest, windows-latest ]

steps:

- uses: actions/checkout@v3

- name: Set Up JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'temurin'

- name: Set Up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.8.8

- name: Cache Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Setup Maven Revision
shell: bash
run: echo "project_revision=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: Update Maven Revision As Snapshot
if: github.event_name != 'release'
shell: bash
run: echo "project_revision=${{ env.project_revision }}-${GITHUB_SHA::6}-SNAPSHOT" >> $GITHUB_ENV

- name: Maven Build and Verify Jar
run: mvn -V -B -e -ff -ntp -P github,release-sign-artifacts -Drevision="${{ env.project_revision }}" clean verify

- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
continue-on-error: true
with:
name: LitFX-${{ env.project_revision }}
path: |
./**/target/*.pom
./**/target/*.jar
./**/target/*.asc
retention-days: 10
if-no-files-found: error

- name: Deploy Github Package
if: runner.os == 'Linux' && (github.ref == 'refs/heads/master' || github.event_name == 'release')
continue-on-error: true
# LitFX is an invalid artifactId per GH Packages, using -fn to allow others to upload
run: mvn -V -B -e -fn -ntp -P github,release-sign-artifacts -Drevision="${{ env.project_revision }}" deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy OSSRH Package
if: runner.os == 'Linux' && (github.ref == 'refs/heads/master' || github.event_name == 'release')
run: mvn -V -B -e -ff -ntp -P ossrh,release-sign-artifacts -Drevision=${{ env.project_revision }} deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-midnight
theme: jekyll-theme-midnight
16 changes: 8 additions & 8 deletions litfx-controls/pom.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>LitFX</artifactId>
<groupId>com.github.birdasaur.litfx</groupId>
<version>0.1.1</version>
<version>${revision}</version>
</parent>

<artifactId>litfx-controls</artifactId>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>14</maven.compiler.source>
<maven.compiler.target>14</maven.compiler.target>
<maven.compiler.release>14</maven.compiler.release>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.release>${java.version}</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>com.github.birdasaur.litfx</groupId>
<artifactId>litfx-core</artifactId>
<version>0.1.1</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${jfx.version}</version>
<scope>${jfx.dependency.scope}</scope>
<version>${javafx.version}</version>
<scope>${javafx.dependency.scope}</scope>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions litfx-controls/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @author Birdasaur
*/
module lit.litfx.controls {
requires lit.litfx.core;
requires transitive lit.litfx.core;
requires javafx.controls;
exports lit.litfx.controls.menus;
exports lit.litfx.controls.output;
exports lit.litfx.controls.covalent;
exports lit.litfx.controls.covalent.events;
}
}
14 changes: 7 additions & 7 deletions litfx-core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>LitFX</artifactId>
<groupId>com.github.birdasaur.litfx</groupId>
<version>0.1.1</version>
<version>${revision}</version>
</parent>

<artifactId>litfx-core</artifactId>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>14</maven.compiler.source>
<maven.compiler.target>14</maven.compiler.target>
<maven.compiler.release>14</maven.compiler.release>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.release>${java.version}</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${jfx.version}</version>
<scope>${jfx.dependency.scope}</scope>
<version>${javafx.version}</version>
<scope>${javafx.dependency.scope}</scope>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion litfx-core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
exports lit.litfx.core.components.fire;
exports lit.litfx.core.components.targeting;
exports lit.litfx.core.utils;
}
}
43 changes: 39 additions & 4 deletions litfx-demos/nbactions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,44 @@
</goals>
<properties>
<skipTests>true</skipTests>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} --module-path ${project.build.directory}/modules --module ${moduleName}/${mainClass}</exec.args>
</properties>
</properties>
</action>
</actions>
<action>
<actionName>run.single.main</actionName>
<packagings>
<packaging>*</packaging>
</packagings>
<goals>
<goal>clean</goal>
<goal>javafx:run</goal>
</goals>
<properties>
<skipTests>true</skipTests>
<mainClassName>${packageClassName}</mainClassName>
</properties>
</action>
<action>
<actionName>debug.single.main</actionName>
<packagings>
<packaging>*</packaging>
</packagings>
<goals>
<goal>clean</goal>
<goal>javafx:run@debug</goal>
</goals>
<properties>
<skipTests>true</skipTests>
<jpda.listen>true</jpda.listen>
<mainClassName>${packageClassName}</mainClassName>
</properties>
</action>
<action>
<actionName>CUSTOM-JLink</actionName>
<displayName>JLink</displayName>
<goals>
<goal>clean</goal>
<goal>javafx:jlink</goal>
</goals>
</action>
</actions>
41 changes: 18 additions & 23 deletions litfx-demos/pom.xml
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>LitFX</artifactId>
<groupId>com.github.birdasaur.litfx</groupId>
<version>0.1.1</version>
<version>${revision}</version>
</parent>

<artifactId>litfx-demos</artifactId>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>14</maven.compiler.source>
<maven.compiler.target>14</maven.compiler.target>
<maven.compiler.release>14</maven.compiler.release>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.release>${java.version}</maven.compiler.release>
<moduleName>lit.litfx.demos</moduleName>
<mainClassName>lit.litfx.demos.TargetingDemo</mainClassName>
</properties>

<dependencies>
<dependency>
<groupId>com.github.birdasaur.litfx</groupId>
<artifactId>litfx-core</artifactId>
<version>0.1.1</version>
</dependency>
<dependency>
<groupId>com.github.birdasaur.litfx</groupId>
<artifactId>litfx-controls</artifactId>
<version>0.1.1</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${jfx.version}</version>
<scope>${jfx.dependency.scope}</scope>
<version>${javafx.version}</version>
<scope>${javafx.dependency.scope}</scope>
</dependency>
</dependencies>

Expand All @@ -44,6 +39,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin.version}</version>
<configuration>
<archive>
<manifest>
Expand All @@ -56,17 +52,16 @@
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${jfx.plugin.version}</version>
<version>${javafx.plugin.version}</version>
<configuration>
<mainClass>${moduleName}/${mainClassName}</mainClass>
<includePathExceptionsInClasspath>true</includePathExceptionsInClasspath>
<!--<stripDebug>true</stripDebug>-->
<!--<compress>2</compress>-->
<!--<noHeaderFiles>true</noHeaderFiles>-->
<!--<noManPages>true</noManPages>-->
<!--<launcher>lit</launcher>-->
<!--<jlinkImageName>litfx</jlinkImageName>-->
<!--<jlinkZipName>litfxzip</jlinkZipName>-->
<stripDebug>true</stripDebug>
<compress>2</compress>
<noHeaderFiles>true</noHeaderFiles>
<noManPages>true</noManPages>
<launcher>litfx</launcher>
<jlinkZipName>image</jlinkZipName>
</configuration>
<executions>
<execution>
Expand All @@ -81,8 +76,8 @@
<debug>true</debug>
<debuglevel>lines,vars,source</debuglevel>
<options>
<!--<option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option>-->
<option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:8000</option>
<option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option>
<!--<option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:8000</option>-->
</options>
<mainClass>${moduleName}/${mainClassName}</mainClass>
<includePathExceptionsInClasspath>true</includePathExceptionsInClasspath>
Expand Down
Loading

0 comments on commit 2dc7be7

Please sign in to comment.