diff --git a/.github/workflows/modrinth_upload.yml b/.github/workflows/modrinth_upload.yml index 2ca430b8..38f03571 100644 --- a/.github/workflows/modrinth_upload.yml +++ b/.github/workflows/modrinth_upload.yml @@ -19,16 +19,28 @@ jobs: with: tag: ${{ steps.release.outputs.tag_name }} + - name: Modify version scheme + run: | + if [[ "${{ steps.release.outputs.tag_name }}" == *"pre"* ]]; then + echo "Replacing prerelease version scheme with SNAPSHOT" + echo "VERSION=$(echo ${{ steps.release.outputs.tag_name }} | sed -E 's/-pre.*/-SNAPSHOT/')" >> $GITHUB_ENV + else + echo "Using release version scheme" + echo "VERSION=${{ steps.release.outputs.tag_name }}" >> $GITHUB_ENV + fi + - name: Parse release type run: | if [[ "${{ steps.release-info.outputs.prerelease }}" == "true" ]]; then - echo "Replacing prerelease version scheme with SNAPSHOT" echo "RELEASE_TYPE=beta" >> $GITHUB_ENV else - echo "Using release version scheme" echo "RELEASE_TYPE=release" >> $GITHUB_ENV fi + - uses: actions/checkout@v3 + with: + ref: ${{ steps.release-info.outputs.tag_name }} + - name: Upload to modrinth.com uses: gradle/gradle-build-action@v2 with: