Skip to content

Commit

Permalink
Publish snapshot versions (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNatan authored Feb 6, 2024
1 parent 32f1481 commit 8dda739
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Publish package
on:
release:
types: [published]
push:
branches: [main]
workflow_dispatch:

jobs:
Expand All @@ -12,9 +14,8 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ plugins {
}

group 'me.devnatan'
version '3.1.0-rc'
version '3.1.0-SNAPSHOT'
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ public final ViewFrame register(View... views) {

for (final View view : views) with(view);

tryEnableMetrics();
checkRelocationIssues();
final boolean libraryAsPluginEnabled = checkRelocationIssues();
if (libraryAsPluginEnabled) tryEnableMetrics();

setRegistered(true);
getPipeline().execute(PipelinePhase.Frame.FRAME_REGISTERED, this);
initializeViews();
Expand Down Expand Up @@ -266,7 +267,7 @@ private void initializeViews() {
}
}

private void checkRelocationIssues() {
private boolean checkRelocationIssues() {
final Plugin plugin = getOwner();
final boolean isLibraryAsPluginEnabled =
getOwner().getServer().getPluginManager().isPluginEnabled("InventoryFramework");
Expand All @@ -278,6 +279,7 @@ private void checkRelocationIssues() {
}

if (!isLibraryAsPluginEnabled && isLibraryPresent) plugin.getLogger().warning(RELOCATION_MESSAGE);
return isLibraryAsPluginEnabled;
}
// endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@

import org.bukkit.plugin.java.JavaPlugin;

public final class InventoryFramework extends JavaPlugin {

public static final String LIBRARY_VERSION = "3.1.0-rc";
}
public final class InventoryFramework extends JavaPlugin {}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import java.util.stream.Collectors;
import java.util.zip.GZIPOutputStream;
import javax.net.ssl.HttpsURLConnection;
import me.devnatan.inventoryframework.runtime.InventoryFramework;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
Expand Down Expand Up @@ -131,7 +130,7 @@ private void appendPlatformData(JsonObjectBuilder builder) {
}

private void appendServiceData(JsonObjectBuilder builder) {
builder.appendField("pluginVersion", InventoryFramework.LIBRARY_VERSION);
builder.appendField("pluginVersion", plugin.getDescription().getVersion());
boolean isShaded = !plugin.getDescription().getName().equals("InventoryFramework");
builder.appendField("libraryOrShaded", isShaded ? "shaded" : "library");
builder.appendField(
Expand Down

0 comments on commit 8dda739

Please sign in to comment.