Skip to content

Commit

Permalink
automate release on ver tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Feb 16, 2021
1 parent ec5504a commit 6aaaa5e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#------------------------------------------------------------------------------
name: Release
#------------------------------------------------------------------------------
# Workflow conditions
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
#------------------------------------------------------------------------------
jobs:
#----------------------------------------------------------------------------
release-notes:
name: Release Notes 📰
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
lfs: true
fetch-depth: 0

# Check 2 most recent tags, overwrites
- name: Tagged Release Notes
run: |
scripts/notes_commits.sh `git tag | tail -n2 | head -n1` `git tag | tail -n1` > release-notes.md
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: release-notes
path: release-notes.md
retention-days: 7
#----------------------------------------------------------------------------
tagged-release:
name: Tagged Release
needs: [release-notes]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:

- name: Download Release Notes
uses: actions/download-artifact@v2
with:
name: release-notes

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
body_path: release-notes.md
Empty file modified workflow/scripts/notes_commits.sh
100644 → 100755
Empty file.

0 comments on commit 6aaaa5e

Please sign in to comment.