diff --git a/.github/workflows/publish-analysis.yml b/.github/workflows/publish-analysis.yml index effc4675..7a04d226 100644 --- a/.github/workflows/publish-analysis.yml +++ b/.github/workflows/publish-analysis.yml @@ -4,8 +4,9 @@ name: Upload Analysis Package on: - release: - types: [published, edited] + push: + tags: + - 'v*' jobs: deploy: @@ -34,3 +35,24 @@ jobs: user: __token__ password: ${{ secrets.PYPI_TOKEN }} packages_dir: analysis-master/dist/ + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: See PyPI + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + 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 + asset_path: analysis-master/dist/tra_analysis-${{ github.ref }}-py3-none-any.whl + asset_name: ${{ github.ref }} + asset_content_type: application/octet-stream