Automatic GitHub releases from git tags
This commit is contained in:
parent
bd05c590e3
commit
ba1ce8b8ec
|
@ -148,3 +148,25 @@ jobs:
|
|||
./vendor/bin/phpunit --coverage-clover coverage-clover.xml
|
||||
curl -LO https://scrutinizer-ci.com/ocular.phar
|
||||
php ocular.phar code-coverage:upload --format=php-clover coverage-clover.xml
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
|
||||
|
||||
# Create release
|
||||
- name: Get release info
|
||||
id: release-info
|
||||
run: |
|
||||
echo "::set-output name=subject::$(git tag --format '%(contents:subject)' --points-at)"
|
||||
git tag --format '%(contents:body)' --points-at > release-body.txt
|
||||
- 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: ${{ steps.release-info.outputs.subject }}
|
||||
body_path: release-body.txt
|
||||
|
|
Loading…
Reference in New Issue