-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publishing to marketplace requires manual editing of release. See actions/create-release#99
- Loading branch information
1 parent
41a2178
commit 05338e3
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
create_release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Fetch tag | ||
run: git fetch --depth=1 origin +${{ github.ref }}:${{ github.ref }} | ||
|
||
- name: Get the release version | ||
id: release_version | ||
run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}" | ||
|
||
- name: Get release description | ||
run: | | ||
description="$(git tag -ln --format=$'%(contents:subject)\n\n%(contents:body)' ${{ steps.release_version.outputs.version }})" | ||
# Fix set-output for multiline strings: https://github.community/t/set-output-truncates-multiline-strings/16852 | ||
description="${description//'%'/'%25'}" | ||
description="${description//$'\n'/'%0A'}" | ||
description="${description//$'\r'/'%0D'}" | ||
echo "$description" | ||
echo "::set-output name=description::$description" | ||
id: release_description | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.release_version.outputs.version }} | ||
release_name: ${{ steps.release_version.outputs.version }} | ||
body: ${{ steps.release_description.outputs.description }} | ||
prerelease: ${{ contains(steps.release_version.outputs.version, '-') }} |