Skip to content

Commit 0c6911a

Browse files
committed
Added create-release workflow
1 parent 5206a19 commit 0c6911a

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/create-release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Create new Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
versionIncrement:
7+
description: 'The new version. For example: 1.1.0'
8+
required: true
9+
default: ''
10+
prerelease:
11+
description: 'Is this a pre-release?'
12+
type: boolean
13+
required: false
14+
default: false
15+
16+
jobs:
17+
release:
18+
name: Publish new release
19+
runs-on: ubuntu-latest
20+
steps:
21+
22+
- name: Checkout repository
23+
uses: actions/checkout@v3.2.0
24+
with:
25+
token: ${{ secrets.PAT }}
26+
persist-credentials: true
27+
fetch-depth: 0
28+
29+
- name: Get changelog entries
30+
id: changelog
31+
uses: mindsers/changelog-reader-action@v2.2.2
32+
with:
33+
version: Unreleased
34+
path: ./CHANGELOG.md
35+
36+
- name: Set up Go
37+
uses: actions/setup-go@v3
38+
with:
39+
go-version: 1.19
40+
41+
- name: Update CHANGELOG file
42+
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
43+
with:
44+
version: ${{ github.event.inputs.versionIncrement }}
45+
46+
- name: Set git config
47+
run: |
48+
git config --local user.email "linkdotnet@action.com"
49+
git config --local user.name "LinkDotNet Bot"
50+
- name: Commit changes and push changes
51+
run: |
52+
git add CHANGELOG.md
53+
git commit -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release"
54+
git push origin main
55+
- name: Create release on GitHub
56+
uses: thomaseizinger/create-release@1.0.0
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.PAT }}
59+
with:
60+
tag_name: v${{ github.event.inputs.versionIncrement }}
61+
target_commitish: ${{ env.RELEASE_COMMIT_HASH }}
62+
name: v${{ github.event.inputs.versionIncrement }}
63+
body: ${{ steps.changelog.outputs.changes }}
64+
draft: false
65+
prerelease: ${{ github.event.inputs.prerelease }}

0 commit comments

Comments
 (0)