Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
When pushing a tag a release is automatically created
  • Loading branch information
claha committed May 20, 2020
1 parent bf9d4f1 commit 6733109
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Release

on: # yamllint disable-line rule:truthy
push:
tags:
- 'v*'

jobs:
release:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- run: git fetch --unshallow

- id: changelog
run: |
curr_tag=$(git describe --tags --abbrev=0)
prev_tag=$(git describe --tags --abbrev=0 $curr_tag^)
echo "Previous tag: $prev_tag"
echo "Current tag: $curr_tag"
log="$(git log --format='- %h %s' $prev_tag..$curr_tag)"
log="${log//'%'/'%25'}"
log="${log//$'\n'/'%0A'}"
log="${log//$'\r'/'%0D'}"
echo "::set-output name=body::$log"
- uses: "actions/create-release@v1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
## Changes
${{ steps.changelog.outputs.body }}
draft: false
prerelease: false

0 comments on commit 6733109

Please sign in to comment.