Skip to content

Commit a1180be

Browse files
authored
Merge pull request #608 from ManimCommunity/naveen521kk-patch-1
ci: upload release assets
2 parents d6f7653 + 16a1004 commit a1180be

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/python-publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,26 @@ jobs:
2626

2727
- name: Publish release to pypi
2828
run: poetry publish --build
29+
30+
- name: Get Upload URL
31+
id: create_release
32+
shell: bash
33+
env:
34+
access_token: ${{ secrets.GITHUB_TOKEN }}
35+
tag_act: ${{ github.ref }}
36+
run: |
37+
ref_tag=$(python -c "print('${tag_act}'.split('/')[-1])")
38+
res=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${access_token}" https://api.github.com/repos/ManimCommunity/manim/releases/tags/${ref_tag})
39+
upload_url=$(python -c "import json;print(json.loads('''${res}''')['upload_url'])")
40+
echo "::set-output name=upload_url::${upload_url}"
41+
42+
- name: Upload Release Asset
43+
id: upload-release
44+
uses: actions/upload-release-asset@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
49+
asset_path: dist/*.tar.gz
50+
asset_name: manimce-${{ steps.tag.outputs.tag }}.tar.gz
51+
asset_content_type: application/gzip

0 commit comments

Comments
 (0)