Skip to content

Commit

Permalink
+ GitHub - Added "shouldRelease" tag into gradle.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
May2Beez committed Sep 30, 2023
1 parent f3c196a commit 27b6457
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
run: |
VERSION=$(grep -Po '^version = .*' gradle.properties | cut -d= -f2)
VERSION=${VERSION#[[:space:]]}
SHOULD_RELEASE=$(grep -Po '^shouldRelease = .*' gradle.properties | cut -d= -f2)
SHOULD_RELEASE=${SHOULD_RELEASE#[[:space:]]}
echo "$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
if [[ $VERSION == *-pre ]]
Expand All @@ -22,6 +24,7 @@ jobs:
fi
echo "Version is $VERSION and release type is $RELEASE_TYPE"
echo "RELEASE_TYPE=$RELEASE_TYPE" >> $GITHUB_OUTPUT
echo "shouldRelease=$SHOULD_RELEASE" >> $GITHUB_OUTPUT
id: get_version
- name: Get short commit sha
id: short_sha
Expand All @@ -43,6 +46,7 @@ jobs:
- name: Create release with files
uses: softprops/action-gh-release@v1
id: create_release
if: steps.get_version.outputs.shouldRelease == 'true'
with:
draft: false
prerelease: ${{ steps.get_version.outputs.RELEASE_TYPE == 'pre-release' }}
Expand All @@ -57,15 +61,15 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

# Step 5: Check for required secret variables
- name: Check for GH_TOKEN and DISCORD_WEBHOOK_URL
- name: Check for DISCORD_WEBHOOK_URL
id: check_secrets
run: |
if [[ -z "${{ secrets.DISCORD_WEBHOOK_URL }}" ]]
then
echo "Secret DISCORD_WEBHOOK_URL not provided, skipping tasks"
echo "::set-output name=result::failure"
echo "result=failure" >> $GITHUB_OUTPUT
else
echo "::set-output name=result::success"
echo "result=success" >> $GITHUB_OUTPUT
fi
# Step 6: Send an embed message with commit details to Discord
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ baseGroup = com.github.may2beez.farmhelperv2
mcVersion = 1.8.9
modid = farmhelper
version = 5.1.1
shouldRelease = false

0 comments on commit 27b6457

Please sign in to comment.