Update CI workflow for main branch and release events
This commit is contained in:
parent
ffc91de77e
commit
9bc1f86e25
1 changed files with 11 additions and 3 deletions
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
|
@ -75,7 +75,15 @@ jobs:
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ncc-build
|
name: ncc-build
|
||||||
path: ncc-build
|
|
||||||
|
- 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"
|
||||||
|
|
||||||
- name: Upload release artifact to GitHub
|
- name: Upload release artifact to GitHub
|
||||||
run: |
|
run: |
|
||||||
|
@ -87,8 +95,8 @@ jobs:
|
||||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
--data-binary @"$BUILD_FILE" \
|
--data-binary @"$BUILD_FILE" \
|
||||||
"$GITHUB_API_URL/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=$(basename $BUILD_FILE)"
|
"${{ steps.get_release.outputs.upload_url }}?name=$(basename $BUILD_FILE)"
|
||||||
else
|
else
|
||||||
echo "Build artifact not found"
|
echo "Build artifact not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
Loading…
Add table
Add a link
Reference in a new issue