-
Notifications
You must be signed in to change notification settings - Fork 211
73 lines (69 loc) · 2.26 KB
/
create-gh-release.yml
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
name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: Github release marker, i.e. 4.20.1.RELEASE
required: true
type: string
workflow_call:
inputs:
version:
description: Github release marker, i.e. 4.20.1.RELEASE
required: true
type: string
permissions:
contents: write
jobs:
changelog:
runs-on: ubuntu-latest
name: Changelog for the release
steps:
- name: Checkout wiki code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
repository: ${{github.repository}}.wiki
- name: Extract Changelog
id: changelog
run: |
release=${{ inputs.version }}
version=`echo "${release%.*}"`
qualifier=`echo "${release##*.}"`
echo $version
echo $qualifier
sed "/${version} ${qualifier}/,/^## .*/!d;//d;s/^* /- /" Changelog.md > ${{ github.workspace }}/gen-changelog.md
- uses: actions/upload-artifact@v4
with:
name: changelog-${{ inputs.version }}-${{ github.run_id }}.md
path: ${{ github.workspace }}/gen-changelog.md
retention-days: 1
release:
needs: [ changelog ]
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/download-artifact@v4
with:
name: changelog-${{ inputs.version }}-${{ github.run_id }}.md
path: ${{ github.workspace }}
- name: Verify Changelog
run: |
cat ${{ github.workspace }}/gen-changelog.md
- name: Push Tag
run: |
git config --global user.name "@spring-projects/spring-ide-admin"
git tag -a ${{ inputs.version }} -m "${{ inputs.version }}"
git push --tags
- name: Create Release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ inputs.version }}
tag_name: ${{ inputs.version }}
release_name: ${{ inputs.version }}
body_path: ${{ github.workspace }}/gen-changelog.md
draft: true
prerelease: false