Skip to content

Commit 1f9cc43

Browse files
authored
Merge pull request #9 from Pinont/dev
Bumb to version 1.3.3
2 parents ed89f8f + 0e7a15d commit 1f9cc43

File tree

5 files changed

+65
-57
lines changed

5 files changed

+65
-57
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,34 +105,20 @@ jobs:
105105
fi
106106
107107
- name: Build (package)
108-
run: mvn -B -s $GITHUB_WORKSPACE/settings.xml package
108+
run: mvn -B -s $GITHUB_WORKSPACE/settings.xml -DskipTests -Pwith-shade package
109109

110110
- name: Deploy Release to GitHub Packages
111111
env:
112112
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113113
run: mvn -B -s $GITHUB_WORKSPACE/settings.xml -DskipTests deploy
114114

115-
- name: Verify built artifacts
116-
run: |
117-
set -e
118-
echo "Contents of target/:"
119-
ls -1 target
120-
# Capture a primary jar (non sources/javadoc) for convenience
121-
MAIN_JAR=$(ls target/*.jar | grep -v '\-sources\.jar$' | grep -v '\-javadoc\.jar$' | head -n1 || true)
122-
if [[ -z "$MAIN_JAR" ]]; then
123-
echo "ERROR: No main artifact jar found."
124-
exit 1
125-
fi
126-
cp "$MAIN_JAR" main-artifact.jar
127-
echo "Selected main artifact: $MAIN_JAR"
128-
129115
- name: Create & Push Git Tag
130116
run: |
131117
set -e
132118
TAG="${{ steps.version.outputs.version }}"
133119
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
134-
echo "Tag ${TAG} already exists unexpectedly (race condition?)."
135-
exit 1
120+
echo "Tag ${TAG} already exists unexpectedly (race condition?)."
121+
exit 1
136122
fi
137123
git config user.name "github-actions[bot]"
138124
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
@@ -146,9 +132,7 @@ jobs:
146132
name: "SingularityLib ${{ steps.version.outputs.version }}"
147133
generate_release_notes: true
148134
files: |
149-
target/*-sources.jar
150-
target/*-javadoc.jar
151-
main-artifact.jar
135+
`target/*.jar`
152136
153137
- name: Summary
154138
run: |

pom.xml

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.github.pinont</groupId>
88
<artifactId>singularitylib</artifactId>
9-
<version>1.3.3-SNAPSHOT</version>
9+
<version>1.3.3</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SingularityLib</name>
@@ -38,6 +38,50 @@
3838
</developer>
3939
</developers>
4040

41+
<profiles>
42+
<profile>
43+
<id>with-shade</id>
44+
<!-- Optional: still allow activation by property 'shade' if you prefer -Dshade=true -->
45+
<activation>
46+
<property>
47+
<name>shade</name>
48+
</property>
49+
</activation>
50+
51+
<build>
52+
<plugins>
53+
<plugin>
54+
<groupId>org.apache.maven.plugins</groupId>
55+
<artifactId>maven-shade-plugin</artifactId>
56+
<version>3.5.3</version>
57+
<configuration>
58+
<!-- Attach shaded artifact instead of replacing the main jar -->
59+
<shadedArtifactAttached>true</shadedArtifactAttached>
60+
<shadedClassifierName>shaded</shadedClassifierName>
61+
<createDependencyReducedPom>false</createDependencyReducedPom>
62+
<filters>
63+
<filter>
64+
<artifact>org.reflections:reflections</artifact>
65+
<includes>
66+
<include>org/reflections/**</include>
67+
</includes>
68+
</filter>
69+
</filters>
70+
</configuration>
71+
<executions>
72+
<execution>
73+
<phase>package</phase>
74+
<goals>
75+
<goal>shade</goal>
76+
</goals>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
</profile>
83+
</profiles>
84+
4185
<scm>
4286
<url>https://github.com/Pinont/SingularityLib</url>
4387
<connection>scm:git:https://github.com/Pinont/SingularityLib.git</connection>
@@ -131,31 +175,6 @@
131175
</executions>
132176
</plugin>
133177

134-
<!-- Shade -->
135-
<plugin>
136-
<groupId>org.apache.maven.plugins</groupId>
137-
<artifactId>maven-shade-plugin</artifactId>
138-
<version>3.5.3</version>
139-
<configuration>
140-
<filters>
141-
<filter>
142-
<artifact>org.reflections:reflections</artifact>
143-
<includes>
144-
<include>org/reflections/**</include>
145-
</includes>
146-
</filter>
147-
</filters>
148-
</configuration>
149-
<executions>
150-
<execution>
151-
<phase>package</phase>
152-
<goals>
153-
<goal>shade</goal>
154-
</goals>
155-
</execution>
156-
</executions>
157-
</plugin>
158-
159178
<!-- Explicit deploy plugin version -->
160179
<plugin>
161180
<groupId>org.apache.maven.plugins</groupId>

src/main/java/com/github/pinont/singularitylib/api/utils/Common.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.github.pinont.singularitylib.api.utils;
22

33
import com.github.pinont.singularitylib.api.enums.PlayerInventorySlotType;
4+
import com.github.pinont.singularitylib.api.manager.ConfigManager;
5+
import com.github.pinont.singularitylib.plugin.CorePlugin;
46
import net.kyori.adventure.text.Component;
57
import net.kyori.adventure.text.minimessage.MiniMessage;
68
import org.bukkit.Bukkit;
@@ -28,6 +30,17 @@ public class Common {
2830
public Common() {
2931
}
3032

33+
/**
34+
* Gets the current API version.
35+
*
36+
* @return the API version string
37+
*/
38+
public static String getAPIVersion() {
39+
ConfigManager apiConfig = new ConfigManager(CorePlugin.getInstance(), "api-version.yml");
40+
String version = apiConfig.getConfig().getString("api-version", "1.0.0");
41+
return "V-" + version;
42+
}
43+
3144
/**
3245
* Colorizes a string message using MiniMessage format.
3346
*

src/main/java/com/github/pinont/singularitylib/plugin/CorePlugin.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.github.pinont.singularitylib.plugin;
22

3+
import com.github.pinont.singularitylib.api.utils.Common;
34
import com.github.pinont.singularitylib.plugin.listener.PlayerListener;
45
import com.github.pinont.singularitylib.api.command.SimpleCommand;
56
import com.github.pinont.singularitylib.api.manager.ConfigManager;
@@ -93,16 +94,6 @@ public static void sendConsoleMessage(String message) {
9394

9495
private final List<Listener> listeners = new ArrayList<>();
9596

96-
/**
97-
* Gets the current API version.
98-
*
99-
* @return the API version string
100-
*/
101-
public static String getAPIVersion() {
102-
String version = "1.3.0";
103-
return "V-" + version;
104-
}
105-
10697
private ConfigManager pluginConfig;
10798

10899
/**
@@ -174,7 +165,7 @@ public final void onEnable() {
174165
}
175166

176167
// Initialize API To Plugin.
177-
sendConsoleMessage(ChatColor.WHITE + "" + ChatColor.ITALIC + "Hooked " + ChatColor.YELLOW + ChatColor.ITALIC + this.getName() + ChatColor.WHITE + ChatColor.ITALIC + " into " + ChatColor.LIGHT_PURPLE + ChatColor.ITALIC + "SingularityAPI! " + getAPIVersion());
168+
sendConsoleMessage(ChatColor.WHITE + "" + ChatColor.ITALIC + "Hooked " + ChatColor.YELLOW + ChatColor.ITALIC + this.getName() + ChatColor.WHITE + ChatColor.ITALIC + " into " + ChatColor.LIGHT_PURPLE + ChatColor.ITALIC + "SingularityAPI! " + Common.getAPIVersion());
178169
onPluginStart();
179170
registerAPIListener(this, new PlayerListener());
180171
// new CommandManager().register(this, this.simpleCommands);

src/main/resources/api-version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
api-version: ${version}

0 commit comments

Comments
 (0)