-
Notifications
You must be signed in to change notification settings - Fork 71
59 lines (52 loc) · 1.76 KB
/
create-release.yml
File metadata and controls
59 lines (52 loc) · 1.76 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
name: Reusable workflow to create release in GitHub
on:
workflow_call:
inputs:
tag_version:
type: string
required: true
description: "Tag version to be published"
last_tag:
type: string
description: "last tag name"
required: true
permissions:
contents: write
actions: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Tag and Push
id: tag_and_push
run: |
TAG_VERSION=${{ inputs.tag_version}}
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git tag -a $TAG_VERSION -m "Release $TAG_VERSION"
git push origin $TAG_VERSION
echo "The tag $TAG_VERSION has been created and pushed to the repository"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set Configuration File
id: set_config
run: |
echo "config_file=configs/configuration.json" >> $GITHUB_ENV
- name: "Build Changelog"
id: github_release
uses: mikepenz/release-changelog-builder-action@a57c1b7c90e56d9c8b26a6ed5d1eed159369e117
with:
configuration: ${{ env.config_file }}
toTag: ${{ inputs.tag_version}}
fromTag: ${{ inputs.last_tag}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: mikepenz/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
with:
body: ${{steps.github_release.outputs.changelog}}
tag_name: ${{ inputs.tag_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}