Skip to content

Commit

Permalink
Improved nightly.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhichang committed Dec 23, 2023
1 parent 5a782e3 commit 8b3ce2c
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,18 @@ jobs:
- name: Build RPM and DEB
run: sudo docker exec infinity_build bash -c "cd /infinity/cmake-build-release && cpack"

- name: Check if Release Exists
id: check_release
- name: Delete Existing nightly build if it exists
run: |
TAG_NAME=nightly
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.MY_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG_NAME \
| jq -r '.id')
echo "::set-output name=release_id::$RELEASE_ID"
- name: Delete Existing Release (Optional)
if: steps.check_release.outputs.release_id != 'null'
run: |
RELEASE_ID=${{ steps.check_release.outputs.release_id }}
curl -X DELETE -H "Authorization: Bearer ${{ secrets.MY_GITHUB_TOKEN }}" \
if [ -n "$RELEASE_ID ]; then
curl -X DELETE -H "Authorization: Bearer ${{ secrets.MY_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID
fi
- name: Create GitHub Release
id: create_release
Expand All @@ -65,9 +60,7 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: |
cmake-build-release/infinity-0.1.0-dev-x86_64.deb
cmake-build-release/infinity-0.1.0-dev-x86_64.rpm
asset_name: |
infinity-0.1.0-dev-x86_64.deb
infinity-0.1.0-dev-x86_64.rpm
cmake-build-release/infinity-*.deb
cmake-build-release/infinity-*.rpm
cmake-build-release/infinity-*.tar.gz
asset_content_type: application/octet-stream

0 comments on commit 8b3ce2c

Please sign in to comment.