-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (75 loc) · 2.69 KB
/
test.yaml
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: 🧨 Create Release Notes
on:
workflow_dispatch:
inputs:
fromTag:
description: 'The from-tag version (e.g. "0.4.7)'
required: true
default: 'x.x.x'
toTag:
description: 'The to-tag version (e.g. "0.4.33)'
required: true
default: 'x.x.x'
jobs:
create-release:
name: 'Create Release Notes'
runs-on: ubuntu-latest
env:
fromTag: v${{ github.event.inputs.fromTag }}
toTag: v${{ github.event.inputs.toTag }}
steps:
# Link to Action: https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@v3
with:
# Loads full history which is required for tagging
fetch-depth: 0
# Link to Action: https://github.com/marketplace/actions/tag-exists-action
- name: 'Check if from-tag exists'
uses: mukunku/[email protected]
id: checkFromTag
with:
tag: ${{ env.fromTag }}
env:
GITHUB_TOKEN: ${{ env.GH_TOKEN }}
- if: ${{ steps.checkFromTag.outputs.exists == 'false' }}
run: |
echo "::error ::Version Tag ${{ env.fromTag }} does not exist"
exit 1
# Link to Action: https://github.com/marketplace/actions/tag-exists-action
- name: 'Check if to-tag exists'
uses: mukunku/[email protected]
id: checkToTag
with:
tag: ${{ env.toTag }}
env:
GITHUB_TOKEN: ${{ env.GH_TOKEN }}
- if: ${{ steps.checkToTag.outputs.exists == 'false' }}
run: |
echo "::error ::Version Tag ${{ env.toTag }} does not exist"
exit 1
# Link to Action: https://github.com/marketplace/actions/release-changelog-builder
- name: Build Changelog
id: buildChangelog
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fromTag: "${{ env.fromTag }}"
toTag: "${{ env.toTag }}"
commitMode: "true"
configuration: ".github/workflows/createReleaseConfig.json"
- name: debug
run: echo "**${{ steps.buildChangelog.outputs.changelog }}**"
# Link to Action: https://github.com/marketplace/actions/gh-release
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body: |
# Release ${{ env.toTag }}
**Full Changelog** ${{ github.server_url }}/${{ github.repository }}/compare/${{ env.fromTag }}...${{ env.toTag }}
```
${{ steps.buildChangelog.outputs.changelog }}
```
name: Production release ${{ env.toTag }}
tag_name: ${{ env.toTag }}