Skip to content

Commit d2633d4

Browse files
committed
chore: update build and release workflow to use extracted plugin version
1 parent 080bcfe commit d2633d4

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
outputs:
13+
PLUGIN_VERSION: ${{ steps.extract_version.outputs.PLUGIN_VERSION }}
1214

1315
steps:
1416
- name: Checkout code
@@ -29,20 +31,18 @@ jobs:
2931
gradle-${{ runner.os }}
3032
3133
- name: Build the plugin
32-
run: ./gradlew build
33-
3434
- name: Extract plugin version
3535
id: extract_version
3636
run: |
3737
VERSION=$(grep -oP 'version = \"\K[^"]+' build.gradle.kts)
3838
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV
39+
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_OUTPUT
40+
VERSION=$(grep -oP 'version = \"\K[^"]+' build.gradle.kts)
41+
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV
3942
4043
- name: Upload build artifact
4144
uses: actions/upload-artifact@v3
4245
with:
43-
name: SkyeNetP-${{ env.PLUGIN_VERSION }}.jar
44-
path: build/libs/SkyeNetP-${{ env.PLUGIN_VERSION }}.jar
45-
4646
release:
4747
needs: build
4848
runs-on: ubuntu-latest
@@ -51,15 +51,18 @@ jobs:
5151
- name: Download build artifact
5252
uses: actions/download-artifact@v3
5353
with:
54-
name: SkyeNetP-${{ env.PLUGIN_VERSION }}.jar
54+
name: SkyeNetP-${{ needs.build.outputs.PLUGIN_VERSION }}.jar
5555

5656
- name: Create GitHub Release
5757
uses: actions/create-release@v1
5858
env:
5959
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6060
with:
61-
tag_name: v${{ env.PLUGIN_VERSION }}
62-
release_name: SkyeNetP v${{ env.PLUGIN_VERSION }}
61+
tag_name: v${{ needs.build.outputs.PLUGIN_VERSION }}
62+
release_name: SkyeNetP v${{ needs.build.outputs.PLUGIN_VERSION }}
63+
draft: false
64+
prerelease: false
65+
files: SkyeNetP-${{ needs.build.outputs.PLUGIN_VERSION }}.jar
6366
draft: false
6467
prerelease: false
6568
files: SkyeNetP-${{ env.PLUGIN_VERSION }}.jar

0 commit comments

Comments
 (0)