Skip to content

Commit

Permalink
Allow publishing experimental versions from a zip url
Browse files Browse the repository at this point in the history
  • Loading branch information
CheaterCodes committed Apr 11, 2022
1 parent a137bcd commit 40f8527
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/generate-and-publish-experimental.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Generate and publish"
on:
workflow_dispatch:
inputs:
url:
description: "URL to the zip containing the Minecraft version json"
required: true

jobs:
generate-and-publish:
name: Generate and publish for Minecraft ${{ github.event.inputs.version }}
runs-on: ubuntu-latest
container:
image: openjdk:16-jdk
options: --user root
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Generate and publish mappings
run: ./gradlew publish -PversionZipUrl="${{ github.event.inputs.url }}" --stacktrace
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Refresh Meta
uses: fjogeleit/http-request-action@master
with:
url: ${{ secrets.META_UPDATE_URL }}
method: 'GET'
preventFailureOnNoResponse: true
26 changes: 0 additions & 26 deletions .github/workflows/generate-and-publish-snapshot.yml

This file was deleted.

2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ dependencies {

if (!versionJsonUrl.isEmpty()) {
tasks.getByName("run").setArgs(["--json", versionJsonUrl])
} else if (!versionZipUrl.isEmpty()) {
tasks.getByName("run").setArgs(["--zip", versionZipUrl])
} else {
tasks.getByName("run").setArgs(["--version", minecraftVersion])
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Dummy variables. Pass the actual value via -P<variable>="<value>"
minecraftVersion =
versionJsonUrl =
versionZipUrl =

0 comments on commit 40f8527

Please sign in to comment.