Skip to content

Commit cd86742

Browse files
committed
refactor GitHub Actions workflow to combine release creation and JAR upload steps
1 parent 3dfb671 commit cd86742

1 file changed

Lines changed: 14 additions & 24 deletions

File tree

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

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,22 @@ jobs:
4242
echo "version=$VERSION" >> $GITHUB_OUTPUT
4343
echo "jar_name=lukittu-simple-$VERSION.jar" >> $GITHUB_OUTPUT
4444
45-
- name: Create Release
46-
id: create_release
47-
uses: actions/create-release@v1
45+
- name: Create Release and Upload JAR
4846
env:
4947
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
with:
51-
tag_name: ${{ github.event.inputs.version || github.ref_name }}
52-
release_name: Release ${{ github.event.inputs.version || github.ref_name }}
53-
body: |
54-
## Changes
55-
- Built from commit ${{ github.sha }}
56-
57-
## Download
58-
Download the JAR file from the assets below.
59-
draft: false
60-
prerelease: false
61-
62-
- name: Upload JAR to Release
63-
uses: actions/upload-release-asset@v1
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
with:
67-
upload_url: ${{ steps.create_release.outputs.upload_url }}
68-
asset_path: target/${{ steps.get_version.outputs.jar_name }}
69-
asset_name: ${{ steps.get_version.outputs.jar_name }}
70-
asset_content_type: application/java-archive
48+
run: |
49+
TAG_NAME="${{ github.event.inputs.version || github.ref_name }}"
50+
RELEASE_NAME="Release $TAG_NAME"
51+
JAR_PATH="target/${{ steps.get_version.outputs.jar_name }}"
52+
53+
# Create release with JAR file
54+
gh release create "$TAG_NAME" "$JAR_PATH" \
55+
--title "$RELEASE_NAME" \
56+
--notes "## Changes
57+
- Built from commit ${{ github.sha }}
58+
59+
## Download
60+
Download the JAR file from the assets below."
7161
7262
- name: Upload JAR as Artifact
7363
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)