-
-
Notifications
You must be signed in to change notification settings - Fork 18
78 lines (64 loc) · 2.58 KB
/
app_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
name: Bump Helm Chart Version
on:
push:
branches:
- main
workflow_dispatch:
inputs:
jellyfin_version:
description: 'Application version to set in Chart.yaml'
required: true
default: '1.0.0'
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: 3.x
- name: Bump chart version and set appVersion
id: bump_version
run: |
# Read the current version from the Chart.yaml
current_version=$(grep '^version:' charts/jellyfin/Chart.yaml | awk '{print $2}')
echo "Current version: $current_version"
# Split the version by dot and increment the minor version
major=$(echo "$current_version" | cut -d '.' -f 1)
minor=$(echo "$current_version" | cut -d '.' -f 2)
patch=$(echo "$current_version" | cut -d '.' -f 3)
new_version="$major.$((minor+1)).0"
echo "New chart version: $new_version"
# Get the app version passed as an input
jellyfin_version="${{ github.event.inputs.jellyfin_version }}"
echo "Setting appVersion to: $jellyfin_version"
# Update the Chart.yaml with the new version and appVersion
sed -i "s/^version:.*/version: $new_version/" charts/jellyfin/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: $jellyfin_version/" charts/jellyfin/Chart.yaml
# Output the new chart version for further use
echo "new_version=$new_version" >> $GITHUB_OUTPUT
- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add charts/jellyfin/Chart.yaml
git commit -m "chore(jellyfin): Bump chart version to ${{ steps.bump_version.outputs.new_version }} and set appVersion to ${{ github.event.inputs.jellyfin_version }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.JF_BOT_TOKEN }}
- name: Create Git tag
id: create_tag
run: |
new_version="${{ steps.bump_version.outputs.new_version }}"
git tag "$new_version"
echo "Tag created: $new_version"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.JF_BOT_TOKEN }}
tags: true