Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Workflow improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
CiroZDP committed Sep 14, 2024
1 parent 995b1bc commit 3d57894
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

# - OpenCraft Studios Team

name: Java CI with Maven
name: Generate artifacts

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

jobs:
build:
Expand All @@ -23,7 +21,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
- name: Download JDK 1.8
id: compile
uses: actions/setup-java@v4
with:
Expand All @@ -32,7 +30,8 @@ jobs:
cache: maven
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build with Maven

- name: Compile client
run: mvn -B package --file pom.xml
env:
MAVEN_USERNAME: CiroZDP
Expand All @@ -42,5 +41,5 @@ jobs:
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'target/OpenCraft-24r12-jar-with-dependencies.jar'
SOURCE_FILE: 'target/client.jar'
DEST_NAME: 'client.jar'
37 changes: 28 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,19 @@
</dependencies>

<build>
<!-- JAR name -->
<finalName>client</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>1.8</source>
<target>1.8</target>

<!-- Lombok for annotations -->
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
Expand All @@ -102,6 +106,8 @@
</annotationProcessorPaths>
</configuration>
</plugin>

<!-- Plugin for resources/ folder -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -110,27 +116,40 @@
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>

<!-- JAR Packaging plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>client</finalName>
<archive>
<manifest>
<mainClass>net.opencraft.OpenCraft</mainClass>
<mainClass>
net.opencraft.OpenCraft
</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

<!-- Dependency packaging plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>make-assembly</id>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Expand Down

0 comments on commit 3d57894

Please sign in to comment.