-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (40 loc) · 1.49 KB
/
release-workflows.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
name: Release Reusable Workflows
on:
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
release-reusable-workflows:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
show-progress: false
fetch-depth: 0
fetch-tags: true
- name: Tag and Release
run: |
git config --global user.name 'Spring Builds'
git config --global user.email '[email protected]'
latestRelease=$(git tag --sort=creatordate | tail -1 | tail -c+2)
if [ -z $latestRelease ]
then
latestRelease=0
fi
releaseVersion=v$(($latestRelease + 1))
for file in ./.github/workflows/spring-*; do
sed -i "1,/WORKFLOWS_REF:.*/s/WORKFLOWS_REF:.*/WORKFLOWS_REF: $releaseVersion/" $file
done
git commit -a -m "Release version $releaseVersion"
git tag $releaseVersion
git push --tags origin
for file in ./.github/workflows/spring-*; do
sed -i "1,/WORKFLOWS_REF:.*/s/WORKFLOWS_REF:.*/WORKFLOWS_REF: main/" $file
done
git commit -a -m "Next development version"
git push origin
RELEASE_URL=$(gh release create $releaseVersion)
echo "::notice title=Release Page::$RELEASE_URL"