Skip to content

Commit

Permalink
Release (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryBorek authored Feb 26, 2024
2 parents fdcdcbb + e3945bd commit 8fe7250
Show file tree
Hide file tree
Showing 48 changed files with 1,240 additions and 748 deletions.
134 changes: 67 additions & 67 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [prerelease ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: "Get Information"
run: |
echo 'VERSION='$(cat pom.xml | grep "^ <version>.*</version>$" | awk -F'[><]' '{print $3}')'-pre' >> $GITHUB_ENV
echo 'VERSIONID='$(cat pom.xml | grep "^ <version>.*</version>$" | awk -F'[><]' '{print $3}')'' >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.VERSION }}
release_name: Prerelease ${{ env.VERSION }}
body: |
Prerelease Automatically Generated by software... Please change draft to add changelog.
draft: true
prerelease: true
# Runs a single command using the runners shell
- name: Build Software
run: mvn clean install

# Runs a set of commands using the runners shell
- name: Upload Console Release
id: upload-console-release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Applications/Console/target/ResourcePackConverter-Console-${{ env.VERSION }}.jar
asset_name: ResourcePackConverter.jar
asset_content_type: application/zip
- name: Upload GUI Release
id: upload-gui-release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Applications/Gui/target/ResourcePackConverter-Gui-${{ env.VERSION }}.jar
asset_name: ResourcePackConverter-Gui-${{ env.VERSION }}.jar
asset_content_type: application/zip
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [prerelease ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: "Get Information"
run: |
echo 'VERSION='$(cat pom.xml | grep "^ <version>.*</version>$" | awk -F'[><]' '{print $3}')'-pre' >> $GITHUB_ENV
echo 'VERSIONID='$(cat pom.xml | grep "^ <version>.*</version>$" | awk -F'[><]' '{print $3}')'' >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.VERSION }}
release_name: Prerelease ${{ env.VERSIONID }}
body: |
Prerelease Automatically Generated by software... Please change draft to add changelog.
draft: true
prerelease: true
# Runs a single command using the runners shell
- name: Build Software
run: mvn clean install

# Runs a set of commands using the runners shell
- name: Upload Console Release
id: upload-console-release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Applications/Console/target/ResourcePackConverter-Console-${{ env.VERSIONID }}.jar
asset_name: ResourcePackConverter.jar
asset_content_type: application/zip
- name: Upload GUI Release
id: upload-gui-release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./Applications/Gui/target/ResourcePackConverter-Gui-${{ env.VERSIONID }}.jar
asset_name: ResourcePackConverter-Gui-${{ env.VERSION }}.jar
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion Applications/Console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Applications</artifactId>
<groupId>com.agentdid127.resourcepack</groupId>
<version>2.2.2</version>
<version>2.2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion Applications/Gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Applications</artifactId>
<groupId>com.agentdid127.resourcepack</groupId>
<version>2.2.2</version>
<version>2.2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
6 changes: 3 additions & 3 deletions Applications/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>ResourcePackConverter</artifactId>
<groupId>com.agentdid127</groupId>
<version>2.2.2</version>
<version>2.2.3</version>

</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -33,12 +33,12 @@
<dependency>
<groupId>com.agentdid127.resourcepack</groupId>
<artifactId>Forwards</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.agentdid127.resourcepack</groupId>
<artifactId>Backwards</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![](https://jitpack.io/v/agentdid127/ResourcePackConverter.svg)](https://jitpack.io/#agentdid127/ResourcePackConverter)


This is my fork of Hypixel's Resource Pack Converter. It updates to any newer version from 1.8.x - 1.17
This is my fork of Hypixel's Resource Pack Converter. It updates to any newer version from 1.8.x - 1.20.x

We know that many use resource packs in nonstandard and quirky ways - but giving this a shot *may* reduce quite a bit of your pain and workload for the 1.13 conversion.

Expand Down
2 changes: 1 addition & 1 deletion conversions/Backwards/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>conversions</artifactId>
<groupId>com.agentdid127.resourcepack</groupId>
<version>2.2.2</version>
<version>2.2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.agentdid127.resourcepack.library.PackConverter;
import com.agentdid127.resourcepack.library.Util;
import com.agentdid127.resourcepack.library.pack.Pack;
import com.agentdid127.resourcepack.library.utilities.Logger;
import com.google.gson.GsonBuilder;

import java.io.IOException;
Expand All @@ -17,77 +18,90 @@
public class BackwardsPackConverter extends PackConverter {
Path INPUT_DIR;

public BackwardsPackConverter(String from, String to, String light, boolean minify, Path input, boolean debug, PrintStream out) {
public BackwardsPackConverter(String from, String to, String light, boolean minify, Path input, boolean debug,
PrintStream out) {
GsonBuilder gsonBuilder = new GsonBuilder().disableHtmlEscaping();
if (!minify)
gsonBuilder.setPrettyPrinting();
gson = gsonBuilder.create();
DEBUG = debug;
PackConverter.out = out;
Logger.setStream(out);
Logger.log(from);
Logger.log(to);
this.INPUT_DIR = input;
log(from);
log(to);
converterRunner(from, to, light);
}

protected void converterRunner(String from, String to, String light) {
// this needs to be run first, other converters might reference new directory
// names
this.registerConverter(new NameConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));

this.registerConverter(
new NameConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));

this.registerConverter(new PackMetaConverter(this, Util.getVersionProtocol(gson, to)));

this.registerConverter(new DeleteFileConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));

this.registerConverter(
new DeleteFileConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));

// TODO: backwards title converter for going from 1.20 to anything below

if (Util.getVersionProtocol(gson, from) >= Util.getVersionProtocol(gson, "1.19.4") && Util.getVersionProtocol(gson, to) < Util.getVersionProtocol(gson, "1.19.4"))
if (Util.getVersionProtocol(gson, from) >= Util.getVersionProtocol(gson, "1.19.4")
&& Util.getVersionProtocol(gson, to) < Util.getVersionProtocol(gson, "1.19.4"))
this.registerConverter(new EnchantPathConverter(this));

if (Util.getVersionProtocol(gson, from) > Util.getVersionProtocol(gson, "1.18") && Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.18")) {
if (Util.getVersionProtocol(gson, from) > Util.getVersionProtocol(gson, "1.18")
&& Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.18")) {
this.registerConverter(new ParticleConverter(this));
this.registerConverter(new InventoryConverter(this));
}

if (Util.getVersionProtocol(gson, from) >= Util.getVersionProtocol(gson, "1.13") && Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.14.4"))
if (Util.getVersionProtocol(gson, from) >= Util.getVersionProtocol(gson, "1.13")
&& Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.14.4"))
this.registerConverter(new PaintingConverter(this));

if (Util.getVersionProtocol(gson, from) > Util.getVersionProtocol(gson, "1.15") && Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.15")) {
if (Util.getVersionProtocol(gson, from) > Util.getVersionProtocol(gson, "1.15")
&& Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.15")) {
this.registerConverter(new EnchantConverter(this));
this.registerConverter(new ChestConverter(this));
}

this.registerConverter(new ParticleTextureConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));
this.registerConverter(new ParticleTextureConverter(this, Util.getVersionProtocol(gson, from),
Util.getVersionProtocol(gson, to)));

if (Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.13"))
this.registerConverter(new LangConverter(this, from, to));

if (Util.getVersionProtocol(gson, from) >= Util.getVersionProtocol(gson, "1.12.2") && Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.13")) {
if (Util.getVersionProtocol(gson, from) >= Util.getVersionProtocol(gson, "1.12.2")
&& Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.13")) {
this.registerConverter(new MapIconConverter(this));
this.registerConverter(new MCPatcherConverter(this));
}

this.registerConverter(new BlockStateConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));

this.registerConverter(new ModelConverter(this, light, Util.getVersionProtocol(gson, to), Util.getVersionProtocol(gson, from)));
this.registerConverter(
new BlockStateConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));

this.registerConverter(new ModelConverter(this, light, Util.getVersionProtocol(gson, to),
Util.getVersionProtocol(gson, from)));

if (Util.getVersionProtocol(gson, from) > Util.getVersionProtocol(gson, "1.9") && Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.9"))
this.registerConverter(new CompassConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));
if (Util.getVersionProtocol(gson, from) > Util.getVersionProtocol(gson, "1.9")
&& Util.getVersionProtocol(gson, to) <= Util.getVersionProtocol(gson, "1.9"))
this.registerConverter(
new CompassConverter(this, Util.getVersionProtocol(gson, from), Util.getVersionProtocol(gson, to)));
}

public void runPack(Pack pack) {
try {
log("Converting " + pack);
Logger.log("Converting " + pack);
pack.getHandler().setup();
log(" Running Converters");
Logger.log(" Running Converters");
for (Converter converter : converters.values()) {
if (DEBUG)
log(" Running " + converter.getClass().getSimpleName());
Logger.log(" Running " + converter.getClass().getSimpleName());
converter.convert(pack);
}
pack.getHandler().finish();
} catch (Throwable t) {
log("Failed to convert!");
Logger.log("Failed to convert!");
Util.propagate(t);
}
}
Expand Down
Loading

0 comments on commit 8fe7250

Please sign in to comment.