-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (114 loc) · 4.63 KB
/
agh3-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
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
name: 🔧 [AGH3] Fetch & Create Chart for Release
on:
workflow_dispatch:
inputs:
chart_version_increment:
description: "Chart Version Increment (Semver)"
required: true
default: "patch"
type: choice
options:
- "minor"
- "patch"
app_version_increment:
description: "App Version Increment (Semver or Use Existing)"
required: true
default: "patch"
type: choice
options:
- "minor"
- "patch"
- "use-existing"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: 🏷️ Get latest Captain tags from Release
uses: oprypin/find-latest-tag@v1
id: captain
with:
repository: Leukocyte-Lab/AGH3-Captain
releases-only: true
token: ${{ secrets.GH_TOKEN }}
- name: 🏷️ Get latest Controller tags from Release
uses: oprypin/find-latest-tag@v1
id: controller
with:
repository: Leukocyte-Lab/AGH3-Controller
releases-only: true
token: ${{ secrets.GH_TOKEN }}
- name: 🏷️ Get latest UI tags from Release
uses: oprypin/find-latest-tag@v1
id: ui
with:
repository: Leukocyte-Lab/AGH3-CTR-UI
releases-only: true
token: ${{ secrets.GH_TOKEN }}
regex: '^v\d+\.\d+\.\d+$'
- name: 🏷️ Get latest Report tags from Release
uses: oprypin/find-latest-tag@v1
id: report
with:
repository: Leukocyte-Lab/AGH3-Report
releases-only: true
token: ${{ secrets.GH_TOKEN }}
- name: 🔔 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🖍️ Update version tags for Apps
uses: mikefarah/[email protected]
with:
cmd: |
cp charts/agh3/values.yaml charts/agh3/values.yaml.tmp
cat charts/agh3/values.yaml.tmp | \
yq '.captain.image.tag = "${{ steps.captain.outputs.tag }}"' | \
yq '.controller.image.tag = "${{ steps.controller.outputs.tag }}"' | \
yq '.ui.image.tag = "${{ steps.ui.outputs.tag }}"' | \
yq '.report.image.tag = "${{ steps.report.outputs.tag }}"' | \
yq '.' > charts/agh3/values.yaml
rm charts/agh3/values.yaml.tmp
- name: 📦 Install Tools for parsing semver
run: |
sudo apt update
sudo apt install gettext-base
sudo wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
sudo chmod +x /usr/local/bin/semver
semver --version
- name: 🔎 Get Chart versions
run: |
export APP_VERSION="$(yq '.appVersion' charts/agh3/Chart.yaml | ${{ inputs.app_version_increment == 'use-existing' && 'sed "s/^v//g"' || format('xargs semver bump {0}', inputs.app_version_increment) }})"
export CHART_VERSION="$(yq '.version' charts/agh3/Chart.yaml | xargs semver bump ${{ inputs.chart_version_increment }})"
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_ENV"
echo "CHART_VERSION=$CHART_VERSION" >> "$GITHUB_ENV"
- name: 🖍️ Update Chart versions
uses: mikefarah/[email protected]
with:
cmd: |
cp charts/agh3/Chart.yaml charts/agh3/Chart.yaml.tmp
cat charts/agh3/Chart.yaml.tmp | \
yq '.version = "${{ env.CHART_VERSION }}"' | \
yq '.appVersion = "v${{ env.APP_VERSION }}"' | \
yq '.' > charts/agh3/Chart.yaml
rm charts/agh3/Chart.yaml.tmp
- name: 🙌 Create PR
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_TOKEN }}
branch: build/release-chart-agh3-${{ env.CHART_VERSION }}
commit-message: |
build: Release chart/agh3 ${{ env.CHART_VERSION }}
- Chart Version: `${{ env.CHART_VERSION }}`
- App Version: `${{ env.APP_VERSION }}`
- Captain: `${{ steps.captain.outputs.tag }}`
- Controller: `${{ steps.controller.outputs.tag }}`
- UI: `${{ steps.ui.outputs.tag }}`
- Report: `${{ steps.report.outputs.tag }}`
title: "build: Release chart/agh3 `v${{ env.CHART_VERSION }}`"
body: |
- Chart Version: `${{ env.CHART_VERSION }}`
- App Version: `${{ env.APP_VERSION }}`
- Captain: `${{ steps.captain.outputs.tag }}`
- Controller: `${{ steps.controller.outputs.tag }}`
- UI: `${{ steps.ui.outputs.tag }}`
- Report: `${{ steps.report.outputs.tag }}`