Merge branch 'dev' #28
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
name: Release | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'version.json' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'version.json' | |
workflow_dispatch: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install jq | |
run: sudo apt-get install jq | |
- name: Get version from version.json | |
id: get_info | |
run: | | |
echo "version=$(node -p "require('./version.json').version")" >> $GITHUB_ENV | |
- name: Get changelog | |
id: get_changelog | |
run: | | |
changelog=$(sed -n '/## v'${{ env.version }}'/,/^## v/p' CHANGELOG.md | sed '/^## v'${{ env.version }}'/d' | sed -n '/###/,/^## v/p' | head -n -1) | |
echo "changelog=$(echo "$changelog" | jq -R -s .)" >> $GITHUB_ENV | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.version }} | |
release_name: v${{ env.version }} | |
body: ${{ fromJSON(env.changelog) }} | |
draft: false | |
prerelease: false |