mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
modrinth upload should work
This commit is contained in:
parent
c5cf2c82b4
commit
9f12da2019
1 changed files with 28 additions and 1 deletions
29
.github/workflows/gradle.yml
vendored
29
.github/workflows/gradle.yml
vendored
|
|
@ -77,6 +77,7 @@ jobs:
|
||||||
|
|
||||||
# Get the names of the online and offline jars
|
# Get the names of the online and offline jars
|
||||||
# grep -v "offline" to exclude offline jar as the regex would catch it otherwise
|
# grep -v "offline" to exclude offline jar as the regex would catch it otherwise
|
||||||
|
# also get the actual version with the
|
||||||
- name: Get file name for jars
|
- name: Get file name for jars
|
||||||
run: |
|
run: |
|
||||||
ONLINE_JAR_PATH=$(ls build/libs/CustomAnvil-*.jar | grep -v "offline")
|
ONLINE_JAR_PATH=$(ls build/libs/CustomAnvil-*.jar | grep -v "offline")
|
||||||
|
|
@ -85,6 +86,9 @@ jobs:
|
||||||
echo "ONLINE_JAR_NAME=$(basename $ONLINE_JAR_PATH)" >> $GITHUB_ENV
|
echo "ONLINE_JAR_NAME=$(basename $ONLINE_JAR_PATH)" >> $GITHUB_ENV
|
||||||
echo "OFFLINE_JAR_NAME=$(basename $OFFLINE_JAR_PATH)" >> $GITHUB_ENV
|
echo "OFFLINE_JAR_NAME=$(basename $OFFLINE_JAR_PATH)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
PARTIALLY_EXTRACTED_VERSION=${ONLINE_JAR_NAME#CustomAnvil-}
|
||||||
|
echo "VERSION=${PARTIALLY_EXTRACTED_VERSION%.jar}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# upload the named jars as artifact
|
# upload the named jars as artifact
|
||||||
- name: Upload online JAR artifact
|
- name: Upload online JAR artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
@ -112,9 +116,32 @@ jobs:
|
||||||
build/libs/${{ env.OFFLINE_JAR_NAME }}
|
build/libs/${{ env.OFFLINE_JAR_NAME }}
|
||||||
|
|
||||||
- name: Hangar release
|
- name: Hangar release
|
||||||
if: ${{ (github.event_name != 'release' || github.event_name != 'push') && github.repository_owner == 'alexcrea' && success() }}
|
if: ${{ (github.event_name == 'release' || github.event_name == 'push') && github.repository_owner == 'alexcrea' && success() }}
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANGELOG: ${{ github.event.release.body }}
|
RELEASE_CHANGELOG: ${{ github.event.release.body }}
|
||||||
IS_GITHUB_PRERELEASE: ${{ github.event.release.prerelease }}
|
IS_GITHUB_PRERELEASE: ${{ github.event.release.prerelease }}
|
||||||
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
|
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
|
||||||
run: ./gradlew publishAllPublicationsToHangar --stacktrace
|
run: ./gradlew publishAllPublicationsToHangar --stacktrace
|
||||||
|
|
||||||
|
- name: Modrinth publish alpha
|
||||||
|
if: ${{ github.event_name == 'push' && github.repository_owner == 'alexcrea' && success() }}
|
||||||
|
uses: cloudnode-pro/modrinth-publish@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.MODRINTH_TOKEN }}
|
||||||
|
project: customanvil
|
||||||
|
version: ${{ env.VERSION }}-dev-${{ env.SMALL_COMMIT_HASH }}
|
||||||
|
loaders: '["spigot", "paper", "purpur", "folia"]'
|
||||||
|
game-versions: '["1.18.x", "1.19.x", "1.20.x", "1.21.x"]'
|
||||||
|
channel: alpha
|
||||||
|
files: build/libs/${{ env.ONLINE_JAR_NAME }}
|
||||||
|
|
||||||
|
- name: Modrinth publish release
|
||||||
|
if: ${{ github.event_name == 'release' && github.repository_owner == 'alexcrea' && success() }}
|
||||||
|
uses: cloudnode-pro/modrinth-publish@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.MODRINTH_TOKEN }}
|
||||||
|
project: customanvil
|
||||||
|
version: ${{ env.VERSION }}${{ github.event.release.prerelease == false && '' || '-pre' }}
|
||||||
|
loaders: '["spigot", "paper", "purpur", "folia"]'
|
||||||
|
game-versions: '["1.18.x", "1.19.x", "1.20.x", "1.21.x"]'
|
||||||
|
files: build/libs/${{ env.ONLINE_JAR_NAME }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue