From 8fb9dc204a4d3bce86c204d20051c57c51efcdc8 Mon Sep 17 00:00:00 2001 From: Brendon Butler Date: Fri, 18 Aug 2023 14:54:34 -0400 Subject: [PATCH] fix create release workflow --- .github/workflows/create-release.yml | 30 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 3803d1b..14ac7f3 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -5,16 +5,6 @@ on: tags: - '*' workflow_dispatch: - inputs: - releaseType: - description: 'Release Type' - required: true - default: release - type: choice - options: - - alpha - - beta - - release jobs: publish-release: @@ -73,6 +63,22 @@ jobs: artifacts: ~/shops-${{ needs.publish-release.outputs.previous-tag }}/shops-${{ needs.publish-release.outputs.previous-tag }}.jar tag: ${{ needs.publish-release.outputs.previous-tag }} + - name: Determine Release Stage + run: | + tag=${{ needs.publish-release.outputs.previous-tag }} + lowercase_tag=$(echo "$tag" | tr '[:upper:]' '[:lower:]') + + if [[ $lowercase_tag == *"beta"* ]]; then + release_stage="beta" + elif [[ $lowercase_tag == *"alpha"* ]]; then + release_stage="alpha" + else + release_stage="release" + fi + + echo "Release stage: $release_stage" + echo "::set-output name=release_stage::$release_stage" + - name: Upload to CurseForge uses: itsmeow/curseforge-upload@v3 with: @@ -80,8 +86,8 @@ jobs: game_endpoint: bukkit relations: vault:requiredDependency,essentialsx:optionalDependency game_versions: 'Minecraft 1.18:1.18.2,Minecraft 1.19:1.19.4,Minecraft 1.20:1.20.1,Java 17' - release_type: ${{ inputs.releaseType }} - display_name: Shops ${{ needs.publish-release.outputs.previous-tag }' + release_type: ${{ steps.create-release.outputs.release_stage }} + display_name: Shops ${{ needs.publish-release.outputs.previous-tag }} #changelog: TODO: ADD GENERATED CHANGELOG #changelog_type: markdown project_id: 873479