-
Notifications
You must be signed in to change notification settings - Fork 283
135 lines (118 loc) · 3.8 KB
/
release.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Internal release
name: "Release"
run-name: "Release from ${{github.ref_name}} by @${{ github.actor }}"
on:
workflow_dispatch:
jobs:
set-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set version
id: version
run: |
echo "version=$(cat version.txt)" | tee -a $GITHUB_OUTPUT
create-git-tag:
needs:
- set-version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Create git tag
run: |
set -x
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git tag ${{needs.set-version.outputs.version}}
git push --no-verify origin ${{needs.set-version.outputs.version}}
release-apps:
needs:
- set-version
- create-git-tag
uses: ./.github/workflows/build_apps.yml
secrets: inherit
with:
version: ${{needs.set-version.outputs.version}}
release-sdk:
needs:
- set-version
- create-git-tag
uses: ./.github/workflows/build_and_publish_sdk.yaml
secrets: inherit
with:
version: ${{needs.set-version.outputs.version}}
is_release: true
publish-helm-chart:
needs:
- set-version
- create-git-tag
uses: ./.github/workflows/publish_helm_chart.yaml
secrets: inherit
with:
version: ${{needs.set-version.outputs.version}}
update_version_txt:
needs:
- set-version
- create-git-tag
- release-apps
- release-sdk
- publish-helm-chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: main
fetch-depth: 0
token: ${{ secrets.GH_PAT_TO_ACCESS_GITHUB_API }}
- name: Bump version on main branch
id: update_version
shell: bash
run: |
set -x
BASE_VERSION=$(tr -d '\r' < version.txt | xargs)
IFS='.' read -r -a version_parts <<< "$BASE_VERSION"
# Ensure all version parts are set
for i in {0..2}; do
version_parts[$i]=${version_parts[$i]:-0}
done
((version_parts[2]++))
new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}"
# Update version file with the new version
echo "$new_version" > version.txt
echo "new_version=${new_version}" >> $GITHUB_OUTPUT
- name: Commit updated version file
shell: bash
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git commit -a -m "Update base version to ${{steps.update_version.outputs.new_version}}"
echo "Version updated to ${{steps.update_version.outputs.new_version}} on main" >> $GITHUB_STEP_SUMMARY
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT_TO_ACCESS_GITHUB_API }}
branch: ${{ github.ref }}
force_with_lease: true
create-github-release:
needs:
- set-version
- create-git-tag
runs-on: ubuntu-latest
steps:
- name: Create Release Changelog
id: release_changelog
uses: jaywcjlove/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
show-emoji: "false"
- name: Create GitHub release
uses: mikepenz/[email protected]
with:
tag_name: ${{needs.set-version.outputs.version}}
body: ${{steps.release_changelog.outputs.changelog}}
generate_release_notes: true