forked from elgohr/Github-Release-Action
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (75 loc) · 2.52 KB
/
build.yml
File metadata and controls
82 lines (75 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build
on:
workflow_dispatch:
concurrency:
group: build
cancel-in-progress: false
jobs:
shellcheck:
name: Check
uses: ./.github/workflows/check.yml
release:
name: Release
needs: shellcheck
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
-
name: Get previous tag
id: previousTag
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
-
name: Generate changelog
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}
writeToFile: false
reverseOrder: true
includeInvalidCommits: true
excludeTypes: "docs,build,chore"
-
name: Create a release
uses: action-pack/github-release@master
with:
tag: "v${{ vars.MAJOR }}.${{ vars.MINOR }}"
title: "v${{ vars.MAJOR }}.${{ vars.MINOR }}"
token: ${{ secrets.REPO_ACCESS_TOKEN }}
body: |
${{ steps.changelog.outputs.changes }}
**Full Changelog**: https://github.com/${{ github.repository }}/compare//${{ env.previousTag }}...v${{ vars.MAJOR }}.${{ vars.MINOR }}
-
name: Update major release
uses: action-pack/github-release@master
with:
tag: "v${{ vars.MAJOR }}"
title: "v${{ vars.MAJOR }}"
token: ${{ secrets.REPO_ACCESS_TOKEN }}
body: |
${{ steps.changelog.outputs.changes }}
**Full Changelog**: https://github.com/${{ github.repository }}/compare//${{ env.previousTag }}...v${{ vars.MAJOR }}.${{ vars.MINOR }}
-
name: Increment version variable
uses: action-pack/bump@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
-
name: Send mail
uses: action-pack/send-mail@v1
with:
to: ${{secrets.MAILTO}}
from: Github Actions <${{secrets.MAILTO}}>
connection_url: ${{secrets.MAIL_CONNECTION}}
subject: Build of ${{ github.event.repository.name }} v${{ vars.MAJOR }}.${{ vars.MINOR }} completed
body: |
The build job of ${{ github.event.repository.name }} v${{ vars.MAJOR }}.${{ vars.MINOR }} was completed successfully!
See https://github.com/${{ github.repository }}/actions for more information.