Skip to content

Commit 290b0e4

Browse files
committed
Automatic GitHub releases from git tags
1 parent be0553a commit 290b0e4

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build
1+
name: main
22
on: [ push, pull_request ]
33
jobs:
44
test:
@@ -121,3 +121,25 @@ jobs:
121121
run: |
122122
curl -LO https://scrutinizer-ci.com/ocular.phar
123123
php ocular.phar code-coverage:upload --format=php-clover coverage-clover.xml
124+
125+
release:
126+
runs-on: ubuntu-latest
127+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
128+
steps:
129+
- uses: actions/checkout@v2
130+
with:
131+
ref: ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
132+
133+
# Create release
134+
- name: Get release info
135+
id: release-info
136+
run: |
137+
echo "::set-output name=subject::$(git tag --format '%(contents:subject)' --points-at)"
138+
git tag --format '%(contents:body)' --points-at > release-body.txt
139+
- uses: actions/create-release@v1
140+
env:
141+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
142+
with:
143+
tag_name: ${{ github.ref }}
144+
release_name: ${{ steps.release-info.outputs.subject }}
145+
body_path: release-body.txt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GraphQL Upload
22

3-
[![Build Status](https://github.com/ecodev/graphql-upload/workflows/build/badge.svg)](https://github.com/ecodev/graphql-upload/actions)
3+
[![Build Status](https://github.com/ecodev/graphql-upload/workflows/main/badge.svg)](https://github.com/ecodev/graphql-upload/actions)
44
[![Code Quality](https://scrutinizer-ci.com/g/Ecodev/graphql-upload/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Ecodev/graphql-upload/?branch=master)
55
[![Code Coverage](https://scrutinizer-ci.com/g/Ecodev/graphql-upload/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Ecodev/graphql-upload/?branch=master)
66
[![Total Downloads](https://poser.pugx.org/ecodev/graphql-upload/downloads.png)](https://packagist.org/packages/ecodev/graphql-upload)

0 commit comments

Comments
 (0)