Update CI workflow for main branch and release events
This commit is contained in:
parent
5f52e7dd9e
commit
ad0c7f3e06
1 changed files with 3 additions and 15 deletions
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
|
@ -75,19 +75,7 @@ jobs:
|
|||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ncc-build
|
||||
|
||||
- name: List files
|
||||
run: |
|
||||
ls -R
|
||||
|
||||
- name: Get the release upload URL
|
||||
id: get_release
|
||||
run: |
|
||||
release_id=$(curl -s \
|
||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
"$GITHUB_API_URL/repos/${{ github.repository }}/releases/tags/${{ github.event.release.tag_name }}" \
|
||||
| jq -r '.upload_url' | sed -e "s/{?name,label}//")
|
||||
echo "::set-output name=upload_url::$release_id"
|
||||
path: ncc-build
|
||||
|
||||
- name: Upload release artifact to GitHub
|
||||
run: |
|
||||
|
@ -99,7 +87,7 @@ jobs:
|
|||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"$BUILD_FILE" \
|
||||
"${{ steps.get_release.outputs.upload_url }}?name=$(basename $BUILD_FILE)"
|
||||
"$GITHUB_API_URL/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=$(basename $BUILD_FILE)"
|
||||
else
|
||||
echo "Build artifact not found"
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Reference in a new issue