Skip to content

Commit 9e8f673

Browse files
committed
Now generate GitHub release
1 parent a3eeb3e commit 9e8f673

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
911
steps:
1012
- name: Checkout Repository
1113
uses: actions/checkout@v6
@@ -22,7 +24,9 @@ jobs:
2224
- name: Determine release status
2325
if: ${{ runner.os == 'Linux' }}
2426
run: |
25-
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
27+
VERSION=$(./gradlew properties | awk '/^version:/ { print $2; }')
28+
echo "VERSION=$VERSION" >> $GITHUB_ENV
29+
if echo "$VERSION" | grep -q '\-SNAPSHOT'; then
2630
echo "STATUS=snapshot" >> $GITHUB_ENV
2731
else
2832
echo "STATUS=release" >> $GITHUB_ENV
@@ -70,6 +74,14 @@ jobs:
7074
with:
7175
name: FastAsyncWorldEdit-Bukkit-SNAPSHOT
7276
path: worldedit-bukkit/build/libs/FastAsyncWorldEdit-*.jar
77+
- name: Create GitHub Release
78+
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
79+
uses: softprops/action-gh-release@v2
80+
with:
81+
tag_name: ${{ env.VERSION }}
82+
name: ${{ env.VERSION }}
83+
files: worldedit-bukkit/build/libs/FastAsyncWorldEdit-*.jar
84+
generate_release_notes: true
7385
- name: Publish to Modrinth
7486
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
7587
run: ./gradlew publishMods

0 commit comments

Comments
 (0)