1+ name : release
2+ # This workflow is triggered on pushes to the repository.
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ env :
9+ WITH_V : true
10+ DEFAULT_BUMP : patch
11+ INITIAL_VERSION : 0.0.0
12+
13+ jobs :
14+ build :
15+ name : release new version
16+ runs-on : ubuntu-latest
17+ if : " !contains(github.event.head_commit.message, 'skip')"
18+ steps :
19+ - uses : actions/checkout@master
20+ with :
21+ fetch-depth : ' 10'
22+
23+ - name : register values
24+ id : register
25+ run : |
26+ echo "::set-output name=release_timestamp::$(date +%Y-%m-%d_%H.%m)"
27+ echo "::set-output name=tag_hash::${GITHUB_SHA::8}"
28+ echo "::set-output name=changelog::$(git log -1 --pretty=format:"%s")"
29+
30+ - name : bump version and push tag
31+ uses : anothrNick/github-tag-action@1.17.0
32+ id : tag
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+
36+ - name : create release
37+ id : create_release
38+ uses : actions/create-release@v1.0.1
39+ env :
40+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41+ with :
42+ tag_name : ${{ steps.tag.outputs.tag }}
43+ release_name : release ${{ steps.version.register.release_timestamp}}
44+ draft : false
45+ prerelease : false
46+ body : |
47+ Changes in this Release ${{ steps.register.tag_hash.changelog }}
48+ - ${{ steps.define-version.register.changelog }}
49+ - Terraform Version: ${{ env.TERRAFORM_VERSION }}
50+ - Terragrunt Version: ${{ env.TERRAGRAUNT_VERSION }}
51+
52+ - name : create release branch
53+ id : create_release_branch
54+ if : " contains(github.event.head_commit.message, 'branch')"
55+ uses : peterjgrainger/action-create-branch@v2.0.0
56+ env :
57+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58+ with :
59+ branch : release/${{ steps.tag.outputs.tag }}
0 commit comments