Skip to content

Commit

Permalink
workflow: update release logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Nov 21, 2024
1 parent ec941e5 commit 01e2a85
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ jobs:
uses: softprops/action-gh-release@master
with:
tag_name: ${{ env.TAG_NAME }}
make_latest: true
make_latest: false
files: |
${{ env.FULL_FW }}
${{ env.FULL_FW_SHA }}
Expand Down Expand Up @@ -266,6 +266,25 @@ jobs:
run: |
echo "TG_DISABLED=${{ github.event.inputs.tg_disabled || 'false' }}" >> $GITHUB_ENV
- name: Set latest release
if: ${{ success() }}
run: |
# Get the release ID for the current tag
RELEASE_ID=$(curl -s \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.TAG_NAME }}" | jq -r '.id')
if [[ "$RELEASE_ID" != "null" ]]; then
curl -X PATCH \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"prerelease": false, "draft": false, "tag_name": "${{ env.TAG_NAME }}", "make_latest": true}' \
"https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID"
echo "Release marked as latest"
else
echo "Release not found, skipping latest release update"
fi
- name: Send completion summary
if: ${{ env.TG_DISABLED == 'false' }}
run: |
Expand Down

0 comments on commit 01e2a85

Please sign in to comment.