Automatic GitHub releases from git tags

This commit is contained in:
Adrien Crivelli 2020-11-26 12:44:07 +09:00
parent bd05c590e3
commit ba1ce8b8ec
No known key found for this signature in database
GPG Key ID: 16D79B903B4B5874
1 changed files with 22 additions and 0 deletions

View File

@ -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