1111 runs-on : ubuntu-latest
1212
1313 permissions :
14+ contents : write # Needed to create a release
1415 actions : read
15- contents : read
1616
1717 steps :
1818 - uses : actions/checkout@v4
@@ -28,23 +28,26 @@ jobs:
2828 - name : Build
2929 run : dotnet build --no-restore -c Debug
3030
31- - name : Upload a Build Artifact
32- uses : actions/upload-artifact@v4
33- with :
34- name : iis_Stupid_Menu-Beta
35- path : bin/Debug/netstandard2.1/ii's Stupid Menu.dll
36-
37- - name : Get Artifact URL
38- id : artifact_url
31+ - name : Rename DLL for Release
3932 run : |
40- ARTIFACT_RESPONSE=$(curl -s \
41- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
42- -H "Accept: application/vnd.github+json" \
43- "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts")
33+ mkdir -p release
34+ cp "bin/Debug/netstandard2.1/ii's Stupid Menu.dll" release/iis_Stupid_Menu.dll
4435
45- ARTIFACT_ID=$(echo "$ARTIFACT_RESPONSE" | jq -r '.artifacts[0].id')
46- echo "artifact_id=$ARTIFACT_ID" >> $GITHUB_OUTPUT
47- echo "artifact_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID " >> $GITHUB_OUTPUT
36+ - name : Get short commit hash
37+ id : vars
38+ run : echo "commit_id=$(git rev-parse --short HEAD) " >> $GITHUB_OUTPUT
4839
40+ - name : Create Pre-Release
41+ uses : softprops/action-gh-release@v2
42+ with :
43+ tag_name : beta-${{ steps.vars.outputs.commit_id }}
44+ name : Pre-Release ${{ steps.vars.outputs.commit_id }}
45+ body : |
46+ # This is a pre-release build!
47+ This version may be unstable, with bugs and issues that could set you at risk.
48+ Only use if you know what you're doing.
49+ draft : false
50+ prerelease : true
51+ files : release/iis_Stupid_Menu.dll
4952 env :
5053 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments