@@ -10,35 +10,47 @@ jobs:
1010 runs-on : ubuntu-latest
1111
1212 steps :
13- - uses : actions/checkout@v2
14-
15- - name : Extract tag name
16- id : tag
17- run : echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
18-
19- - name : Create release
20- id : create_release
21- uses : actions/create-release@v1
22- env :
23- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24- with :
25- tag_name : ${{ github.ref }}
26- release_name : ${{ github.ref }}
27- draft : true
28- prerelease : false
29- body : |
30- This is the ${{ github.ref }} release of ${{ env.GITHUB_REPOSITORY }}
31-
32- ### Major Changes
33- ### Minor Changes
34- ### Bug fixes
35-
36- - name : Build and push Docker image
37- uses : docker/build-push-action@v1
38- with :
39- username : ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }}
40- password : ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }}
41- repository : ${{ env.GITHUB_REPOSITORY }}
42- add_git_labels : true
43- dockerfile : build/Dockerfile
44- tags : latest, ${{ steps.tag.outputs.VERSION }}
13+ - uses : actions/checkout@v2
14+ with :
15+ fetch-depth : 0
16+
17+ - name : Setup Go
18+ uses : actions/setup-go@v2
19+ with :
20+ go-version : ' ^1.15'
21+
22+ - name : Setup go-chglog
23+ working-directory : /tmp
24+ env :
25+ VERSION : " 0.10.0"
26+ run : |
27+ wget https://github.com/git-chglog/git-chglog/releases/download/v${VERSION}/git-chglog_${VERSION}_linux_amd64.tar.gz
28+ gunzip git-chglog_${VERSION}_linux_amd64.tar.gz
29+ tar -xvf git-chglog_${VERSION}_linux_amd64.tar
30+ sudo mv git-chglog /usr/local/bin/
31+
32+ - name : Generate changelog
33+ run : git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
34+
35+ - name : Create Release
36+ id : create_release
37+ uses : actions/create-release@v1
38+ env :
39+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40+ with :
41+ tag_name : ${{ github.ref }}
42+ release_name : ${{ github.ref }}
43+ draft : true
44+ prerelease : false
45+ body_path : RELEASE_CHANGELOG.md
46+
47+ # Check if we need to build using dockerfile in the release. If yes, uncomment below.
48+ # - name: Build and push Docker image
49+ # uses: docker/build-push-action@v1
50+ # with:
51+ # username: ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }}
52+ # password: ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }}
53+ # repository: ${{ env.GITHUB_REPOSITORY }}
54+ # add_git_labels: true
55+ # dockerfile: build/Dockerfile
56+ # tags: latest, ${{ steps.tag.outputs.VERSION }}
0 commit comments