Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b14df0881 | ||
|
|
11b2c3ff41 | ||
|
|
b842426448 | ||
|
|
3f789ecd25 |
No files matched your search
@@ -115,53 +115,35 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Download the current dev-builds.txt
|
||||
curl -L -o dev-builds.txt https://github.com/CASELOAD7000/knockback-sync/releases/latest/download/dev-builds.txt
|
||||
curl -L -o dev-builds.txt https://github.com/Axionize/knockback-sync/releases/download/hashlist/dev-builds.txt
|
||||
|
||||
# Create a copy of the original file
|
||||
cp dev-builds.txt dev-builds.txt.original
|
||||
|
||||
# Ensure the file ends with a newline
|
||||
# Ensure the file ends with a newline, then append new information
|
||||
sed -i -e '$a\' dev-builds.txt
|
||||
# echo "KnockBackSync-${{ env.NEW_VERSION }}.jar" >> dev-builds.txt
|
||||
echo "${{ env.ORIGINAL_HASH }}" >> dev-builds.txt
|
||||
# echo "KnockBackSync-${{ env.NEW_VERSION }}-remapped.jar" >> dev-builds.txt
|
||||
echo "${{ env.REMAPPED_HASH }}" >> dev-builds.txt
|
||||
|
||||
# Function to add hash if it doesn't exist
|
||||
add_hash_if_new() {
|
||||
if ! grep -q "$1" dev-builds.txt; then
|
||||
echo "$1" >> dev-builds.txt
|
||||
fi
|
||||
}
|
||||
echo "${{ env.FABRIC_HASH }}" >> dev-builds.txt
|
||||
|
||||
# Add new hashes if they don't exist
|
||||
add_hash_if_new "${{ env.ORIGINAL_HASH }}"
|
||||
add_hash_if_new "${{ env.REMAPPED_HASH }}"
|
||||
add_hash_if_new "${{ env.FABRIC_HASH }}"
|
||||
# Get the release ID for the 'hashlist' release
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
|
||||
"https://api.github.com/repos/Axionize/knockback-sync/releases/tags/hashlist" | jq -r .id)
|
||||
|
||||
# Check if the file has changed
|
||||
if cmp -s dev-builds.txt dev-builds.txt.original; then
|
||||
echo "No changes to dev-builds.txt, skipping upload."
|
||||
else
|
||||
echo "Changes detected in dev-builds.txt, uploading new version."
|
||||
|
||||
# Get the latest release ID
|
||||
RELEASE_ID=$(curl -s "https://api.github.com/repos/CASELOAD7000/knockback-sync/releases/latest" | jq -r .id)
|
||||
|
||||
# Delete the old dev-builds.txt asset
|
||||
ASSET_ID=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
|
||||
"https://api.github.com/repos/CASELOAD7000/knockback-sync/releases/$RELEASE_ID/assets" | \
|
||||
jq -r '.[] | select(.name == "dev-builds.txt") | .id')
|
||||
if [ ! -z "$ASSET_ID" ]; then
|
||||
curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" \
|
||||
"https://api.github.com/repos/CASELOAD7000/knockback-sync/releases/assets/$ASSET_ID"
|
||||
fi
|
||||
|
||||
# Upload the new dev-builds.txt
|
||||
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @dev-builds.txt \
|
||||
"https://uploads.github.com/repos/CASELOAD7000/knockback-sync/releases/$RELEASE_ID/assets?name=dev-builds.txt"
|
||||
# Delete the old dev-builds.txt asset
|
||||
ASSET_ID=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
|
||||
"https://api.github.com/repos/Axionize/knockback-sync/releases/$RELEASE_ID/assets" | \
|
||||
jq -r '.[] | select(.name == "dev-builds.txt") | .id')
|
||||
if [ ! -z "$ASSET_ID" ]; then
|
||||
curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" \
|
||||
"https://api.github.com/repos/Axionize/knockback-sync/releases/assets/$ASSET_ID"
|
||||
fi
|
||||
|
||||
# Clean up
|
||||
rm dev-builds.txt.original
|
||||
# Upload the new dev-builds.txt
|
||||
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @dev-builds.txt \
|
||||
"https://uploads.github.com/repos/Axionize/knockback-sync/releases/$RELEASE_ID/assets?name=dev-builds.txt"
|
||||
|
||||
- name: Create artifacts directory
|
||||
run: mkdir -p artifacts
|
||||
@@ -221,7 +203,7 @@ jobs:
|
||||
|
||||
name: KnockbackSync-${{ env.NEW_VERSION }}
|
||||
version: ${{ env.NEW_VERSION }}
|
||||
version-type: beta
|
||||
version-type: alpha
|
||||
|
||||
loaders: |
|
||||
fabric
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ subprojects {
|
||||
apply(plugin = "java")
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_16
|
||||
targetCompatibility = JavaVersion.VERSION_16
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
// if (project.name != "common") {
|
||||
|
||||
+9
-10
@@ -63,10 +63,12 @@ dependencies {
|
||||
compileOnly("org.projectlombok:lombok:1.18.34")
|
||||
annotationProcessor("org.projectlombok:lombok:1.18.34")
|
||||
|
||||
shadeThisThing(implementation("org.kohsuke:github-api:1.326") {
|
||||
exclude(group = "commons-io", module = "commons-io")
|
||||
exclude(group = "org.apache.commons", module = "commons-lang3")
|
||||
})
|
||||
shadeThisThing(implementation("org.kohsuke:github-api:1.326")!!)
|
||||
|
||||
// shadeThisThing(implementation("org.kohsuke:github-api:1.326") {
|
||||
// exclude(group = "commons-io", module = "commons-io")
|
||||
// exclude(group = "org.apache.commons", module = "commons-lang3")
|
||||
// })
|
||||
|
||||
|
||||
shadeThisThing(implementation("com.fasterxml.jackson.core:jackson-databind:2.17.2")!!)
|
||||
@@ -78,15 +80,12 @@ dependencies {
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
// Exclude Java 21 specific classes
|
||||
exclude("META-INF/**")
|
||||
// exclude("META-INF/**")
|
||||
|
||||
// archiveClassifier.set("-all")
|
||||
configurations = listOf(shadeThisThing)
|
||||
isEnableRelocation = true
|
||||
relocationPrefix = "${project.property("maven_group")}.${project.property("archives_base_name")}.shaded"
|
||||
|
||||
// Exclude Java 21 specific classes
|
||||
exclude("META-INF/**")
|
||||
}
|
||||
|
||||
//tasks.named("reobfJar") {
|
||||
@@ -117,6 +116,6 @@ tasks.processResources {
|
||||
//}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_16
|
||||
targetCompatibility = JavaVersion.VERSION_16
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
Reference in new issue
Block a user