Skip to content

Commit

Permalink
use outputs to capture body from file instead of bodyFromFile
Browse files Browse the repository at this point in the history
  • Loading branch information
kne42 committed Apr 16, 2020
1 parent 85446a7 commit 555560d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/make_release.yml
Expand Up @@ -27,30 +27,35 @@ jobs:
pip install wheel
python setup.py sdist bdist_wheel
- name: Find Release Notes
id: release_notes
run: |
TAG="${GITHUB_REF/refs\/tags\/v/}" # clean tag
VER="${TAG/rc*/}" # remove pre-release identifier
RELEASE_FILEPATH=docs/release/release_${VER//./_}.rst
RELEASE_NOTES="$(cat docs/release/release_${VER//./_}.rst)"
# https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/m-p/38372/highlight/true#M3322
RELEASE_NOTES="${RELEASE_NOTES//'%'/'%25'}"
RELEASE_NOTES="${RELEASE_NOTES//$'\n'/'%0A'}"
RELEASE_NOTES="${RELEASE_NOTES//$'\r'/'%0D'}"
# https://help.github.com/en/actions/reference/workflow-commands-for-github-actions
echo "::set-env name=tag::$TAG"
echo "::set-env name=release_filepath::$RELEASE_FILEPATH"
echo "::set-output name=contents::$RELEASE_NOTES"
- name: Create Release
id: create_release
uses: jbolda/create-release@v1.1.0 # switch to actions/create-release@latest once actions/create-release#50 merged
uses: actions/create-release@latest
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: ${{ env.tag }}
bodyFromFile: ${{ env.release_filepath }}
body: ${{ steps.release_notes.outputs.contents }}
draft: false
prerelease: ${{ contains(github.ref, 'rc') }}
- name: 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
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/napari-${{ env.tag }}.tar.gz
asset_name: napari-${{ env.tag }}.tar.gz
asset_content_type: application/gzip
Expand Down

0 comments on commit 555560d

Please sign in to comment.