-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 2.09 KB
/
publish-helm.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
name: Publish Helm charts
# TODO: is it possible to run this workflow only if the check-code-quality workflow has completed successfully ?
# I've tried workflow_run but see:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
# Note: This event will only trigger a workflow run if the workflow file is on the default branch.
# Run workflow only for new git tags (including hierarchical tags like v1.0/beta), or manually
on:
push:
tags:
- '**'
branches:
- 'feat134/helm-chart-releaser'
workflow_dispatch:
env:
DOCKER_REGISTRY: ghcr.io
jobs:
#######################
# Publish Helm charts #
#######################
rs-server-helm-chart:
runs-on: ubuntu-latest
name: "rs-server Helm chart"
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for all branches and tags.
- name: Get the rs-server version tag
id: get_version
shell: bash
run: |
# Enable pipefail so git command failures do not result in null versions downstream
set -x
echo "RSSERVER_VERSION=$(\
git ls-remote --tags --refs --sort="v:refname" \
https://github.com/RS-PYTHON/rs-server.git 'v*.*' | tail -n1 | sed 's/.*\///' | sed 's/^v//' | cut -d '.' -f 1 \
)" >> $GITHUB_OUTPUT
- name: Update version number in chart.yaml
shell: bash
run: |
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.RSSERVER_VERSION }}," charts/rs-server-adgs/Chart.yaml
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.RSSERVER_VERSION }}," charts/rs-server-cadip/Chart.yaml
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.RSSERVER_VERSION }}," charts/mockup-station-adgs/Chart.yaml
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.RSSERVER_VERSION }}," charts/mockup-station-cadip/Chart.yaml
- id: publish-chart
uses: ./.github/actions/publish-chart
with:
github_token: ${{ secrets.GITHUB_TOKEN }}