Update npm-publish-github-packages.yml to upload release asset

This commit is contained in:
LFu 2022-02-12 02:15:30 +08:00 committed by Lyuwen Fu
parent a378a0e5a2
commit 556d80b7c9

View file

@ -45,3 +45,14 @@ jobs:
uses: actions/upload-artifact@v2.3.1
with:
path: fork-awesome.tgz
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'release'
with:
upload_url: ${{ github.event.release.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
asset_path: ./fork-awesome.tgz
asset_name: fork-awesome.tgz
asset_content_type: application/tar+gzip