Skip to content

Commit 7d889f7

Browse files
authored
Merge pull request #251 from jrjohnson/add-release-automation
2 parents 025a990 + 8dd73a2 commit 7d889f7

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release Notes
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
notes:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Get Previous Tag
16+
id: previousTag
17+
run: |
18+
PREVIOUS_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))
19+
echo ${PREVIOUS_TAG}
20+
echo ::set-output name=tag::${PREVIOUS_TAG}
21+
- name: Get New Tag
22+
id: nextTag
23+
run: |
24+
NEW_TAG=${GITHUB_REF#refs/tags/}
25+
echo ${NEW_TAG}
26+
echo ::set-output name=tag::${NEW_TAG}
27+
- uses: actions/setup-node@v2
28+
- name: Generate Release Notes
29+
id: notes
30+
run: |
31+
NOTES=$(npx generate-github-release-notes jrjohnson ember-cli-image-transformer ${{ steps.previousTag.outputs.tag }} ${{steps.nextTag.outputs.tag}})
32+
echo ${NOTES}
33+
# remove line breaks from notes so they can be passed around
34+
NOTES="${NOTES//$'\n'/'%0A'}"
35+
echo "::set-output name=releaseNotes::$NOTES"
36+
- uses: ncipollo/release-action@v1
37+
with:
38+
body: ${{steps.notes.outputs.releaseNotes}}
39+
token: ${{ secrets.MY_TOKEN }}

.github/workflows/tag_version.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tag Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseType:
7+
description: 'Semver Release Type (major,minor,patch)'
8+
required: true
9+
10+
jobs:
11+
tag:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
token: ${{ secrets.MY_TOKEN }}
17+
- name: Validate releaseType
18+
run: npx in-string-list ${{ github.event.inputs.releaseType }} major,minor,patch
19+
- name: Setup Git
20+
run: |
21+
git config --global user.name "Jonathan Johnson"
22+
git config --global user.email "jon.johnson@ucsf.edu"
23+
- name: Increment Version
24+
run: npm version ${{ github.event.inputs.releaseType }}
25+
- name: Push Changes
26+
run: git push --follow-tags

0 commit comments

Comments
 (0)