Skip to content

Commit 119d7b9

Browse files
committed
Will this work
1 parent b0bdfd6 commit 119d7b9

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,21 @@ jobs:
8888

8989
- name: Create GitHub Release
9090
id: create_release
91-
uses: actions/create-release@v1
92-
with:
93-
tag_name: ${{ steps.taginfo.outputs.tag }}
94-
release_name: ${{ steps.taginfo.outputs.tag }}
95-
body: ${{ steps.taginfo.outputs.body }}
96-
draft: false
97-
prerelease: false
98-
env:
99-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
run: |
92+
RESPONSE=$(curl -X POST \
93+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
94+
-H "Accept: application/vnd.github.v3+json" \
95+
https://api.github.com/repos/${{ github.repository }}/releases \
96+
-d "{\"tag_name\":\"${{ steps.taginfo.outputs.tag }}\",\"name\":\"${{ steps.taginfo.outputs.tag }}\",\"body\":$(echo '${{ steps.taginfo.outputs.body }}' | jq -Rs .),\"draft\":false,\"prerelease\":false}")
97+
98+
UPLOAD_URL=$(echo $RESPONSE | jq -r '.upload_url' | sed 's/{?name,label}//')
99+
echo "upload_url=$UPLOAD_URL" >> $GITHUB_OUTPUT
100100
101101
- name: Upload release asset
102-
uses: actions/upload-release-asset@v1
103-
with:
104-
upload_url: ${{ steps.create_release.outputs.upload_url }}
105-
asset_path: ./artifacts/${{ needs.build.outputs.filename }}
106-
asset_name: ${{ needs.build.outputs.filename }}
107-
asset_content_type: application/java-archive
102+
run: |
103+
JAR_FILE=$(ls artifacts/*.jar | grep -v sources | head -1)
104+
curl -X POST \
105+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
106+
-H "Content-Type: application/octet-stream" \
107+
--data-binary @"$JAR_FILE" \
108+
"${{ steps.create_release.outputs.upload_url }}?name=$(basename $JAR_FILE)"

0 commit comments

Comments
 (0)