Skip to content

Commit

Permalink
use blob builds with auto updater
Browse files Browse the repository at this point in the history
  • Loading branch information
FN-FAL113 committed Dec 22, 2023
1 parent 88094d2 commit bb0c8fe
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 7 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/blob-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and Deploy to Blob-Builds

on:
push:
branches:
- main
workflow_dispatch:


jobs:
blob-build-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 16
uses: actions/setup-java@v1
with:
java-version: 16

- name: Build with Maven
run: mvn package

- name: Upload to Blob Builds
uses: WalshyDev/blob-builds/gh-action@main
with:
project: SfChunkInfo
apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }}
releaseNotes: ${{ github.event.head_commit.message }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*.ipr
*.iws

# vs code
*.vscode

# IntelliJ
out/

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Works on 1.14+ minecraft spigot/paper/forks version
```Permission node: sfchunkinfo.scan.others```

## Download official build (with auto updates)
[![Build Status](https://thebusybiscuit.github.io/builds/FN-FAL113/SfChunkInfo/main/badge.svg)](https://thebusybiscuit.github.io/builds/FN-FAL113/SfChunkInfo/main)
### [Download Official Jar](https://blob.build/project/SfChunkInfo)


## Scanning a location chunk
Expand Down Expand Up @@ -49,3 +49,10 @@ Works on 1.14+ minecraft spigot/paper/forks version
<img src="https://discordapp.com/api/guilds/809178621424041997/widget.png?style=banner3" alt="Discord Invite"/>
</a>
</p>

## 💖 Support the Project/Dev
I develop stuff for free with dedication and hard work. Sharing this project with fellow minecraft gamers/server owners or giving it a star is a huge sign of appreciation!</br>
a donation button (currently using parent's paypal due to my pending account requirements).<br/>
<a href="https://www.paypal.com/paypalme/ameliaOrbeta" target=_blank>
<img src="https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png" alt="Donate with PayPal" width="40%" />
</a>
33 changes: 31 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.fnfal113</groupId>
<artifactId>SfChunkInfo</artifactId>
<version>Unoffical-1.5.0</version>
<version>Unoffical-1.6.0</version>
<packaging>jar</packaging>

<name>SfChunkInfo</name>
Expand All @@ -17,6 +17,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<url>https://github.com/FN-FAL113/SfChunkInfo</url>

<build>
<finalName>${project.name} v${project.version}</finalName>
<defaultGoal>clean package</defaultGoal>
Expand Down Expand Up @@ -45,7 +47,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -54,15 +56,27 @@
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>true</minimizeJar>
</configuration>
</execution>
</executions>
<configuration>
<!-- shaded packages -->
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>me.fnfal113.sfchunkinfo.bstats</shadedPattern>
</relocation>

<relocation>
<pattern>io.github.bakedlibs.dough.updater</pattern>
<shadedPattern>me.fnfal113.sfchunkinfo.dough.updater</shadedPattern>
</relocation>
<!-- a transitive dependency, necessary for dough-updater -->
<relocation>
<pattern>io.github.bakedlibs.dough.versions</pattern>
<shadedPattern>me.fnfal113.sfchunkinfo.dough.versions</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
Expand All @@ -81,6 +95,7 @@
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>

<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
Expand All @@ -102,6 +117,20 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.github.baked-libs.dough</groupId>
<artifactId>dough-updater</artifactId>
<version>4b28bd408e</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.github.baked-libs.dough</groupId>
<artifactId>dough-common</artifactId>
<version>4b28bd408e</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/me/fnfal113/sfchunkinfo/SfChunkInfo.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.fnfal113.sfchunkinfo;

import io.github.bakedlibs.dough.updater.BlobBuildUpdater;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.GitHubBuildsUpdater;
import me.fnfal113.sfchunkinfo.commands.ScanChunk;
import org.bstats.bukkit.Metrics;
import org.bukkit.plugin.java.JavaPlugin;
Expand Down Expand Up @@ -29,10 +29,9 @@ public void onEnable() {
getConfig().options().copyDefaults();
saveDefaultConfig();

if (getConfig().getBoolean("auto-update", true) && getDescription().getVersion().startsWith("DEV - ")) {
new GitHubBuildsUpdater(this, getFile(), "FN-FAL113/SfChunkInfo/main").start();
if (getConfig().getBoolean("auto-update", true) && getDescription().getVersion().startsWith("Dev - ")) {
new BlobBuildUpdater(this, getFile(), "SfChunkInfo").start();
}

}

@Override
Expand Down

0 comments on commit bb0c8fe

Please sign in to comment.