-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (84 loc) · 3.44 KB
/
agh3-playground-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
name: 🔧 [AGH3-Playground] 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 Playground tags from Release
uses: oprypin/find-latest-tag@v1
id: ui
with:
repository: Leukocyte-Lab/AGH3-CTR-Playground
releases-only: true
token: ${{ secrets.GH_TOKEN }}
regex: '^v\d+\.\d+\.\d+$'
- name: 🔔 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🖍️ Update version tags for Apps
uses: mikefarah/[email protected]
with:
cmd: |
cp charts/playground/values.yaml charts/playground/values.yaml.tmp
cat charts/playground/values.yaml.tmp | \
yq '.playground.image.tag = "${{ steps.ui.outputs.tag }}"' | \
yq '.' > charts/playground/values.yaml
rm charts/playground/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/playground/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/playground/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/playground/Chart.yaml charts/playground/Chart.yaml.tmp
cat charts/playground/Chart.yaml.tmp | \
yq '.version = "${{ env.CHART_VERSION }}"' | \
yq '.appVersion = "v${{ env.APP_VERSION }}"' | \
yq '.' > charts/playground/Chart.yaml
rm charts/playground/Chart.yaml.tmp
- name: 🙌 Create PR
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_TOKEN }}
branch: build/release-chart-agh3-playground-${{ env.CHART_VERSION }}
commit-message: |
build: Release chart/agh3-playground ${{ env.CHART_VERSION }}
- Chart Version: `${{ env.CHART_VERSION }}`
- App Version: `${{ env.APP_VERSION }}`
- Playground: `${{ steps.ui.outputs.tag }}`
title: "build: Release chart/agh3-playground `v${{ env.CHART_VERSION }}`"
body: |
- Chart Version: `${{ env.CHART_VERSION }}`
- App Version: `${{ env.APP_VERSION }}`
- Playground: `${{ steps.ui.outputs.tag }}`