Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nleconte-csgroup committed Apr 17, 2024
1 parent 4385c20 commit 992641c
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 19 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/doc-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,22 @@ jobs:
# Enable pipefail so git command failures do not result in null versions downstream
set -x
echo "RSSERVER_VERSION=$(\
echo "APP_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 \
https://github.com/RS-PYTHON/rs-server.git 'v0.*a*' | tail -n1 | sed 's/.*\///' \
)" >> $GITHUB_OUTPUT
echo "SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
echo "CHART_VERSION=0.$(\
git ls-remote --tags --refs --sort="v:refname" \
https://github.com/RS-PYTHON/rs-server.git 'v0.*a*' | tail -n1 | sed 's/.*\///' | sed 's/^v//' | sed 's/.\{3\}/&-/' \
)" >> $GITHUB_OUTPUT
- name: Update version number in chart.yaml
shell: bash
run: |
for chart in $(find charts -name Chart.yaml); do
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.RSSERVER_VERSION }}.0.0-${{ steps.get_version.outputs.SHA_SHORT }}," $chart
sed -i "s,{{APP_VERSION}},${{ steps.get_version.outputs.APP_VERSION }}," $chart
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.CHART_VERSION }}," $chart
done
- name: Run helm-docs
Expand Down
34 changes: 26 additions & 8 deletions .github/workflows/publish-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
push:
tags:
- '**'
# branches:
# - 'feat134/helm-chart-releaser'
branches:
- 'feat**'
workflow_dispatch:

env:
Expand Down Expand Up @@ -40,17 +40,35 @@ jobs:
# 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
echo "SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
echo "APP_VERSION=$(\
git ls-remote --tags --refs --sort="v:refname" \
https://github.com/RS-PYTHON/rs-server.git 'v0.*a*' | tail -n1 | sed 's/.*\///' \
)" >> $GITHUB_OUTPUT
# v0.1a7
if [ "$GITHUB_REF_TYPE" == "tag" ]; then
echo "CHART_VERSION=0.$(echo $GITHUB_REF_NAME | sed 's/.*\///' | sed 's/^v//' | sed 's/^v//' | sed 's/.\{3\}/&-/')" >> $GITHUB_OUTPUT
# v0.1a7 => 0.0.1-a7
elif [ "$GITHUB_REF_TYPE" == "branch" ]; then
echo "CHART_VERSION=0.$(\
git ls-remote --tags --refs --sort="v:refname" \
https://github.com/RS-PYTHON/rs-server.git 'v0.*a*' | tail -n1 | sed 's/.*\///' | sed 's/^v//' | sed 's/.\{3\}/&-/' \
)-${{ steps.get_version.outputs.SHA_SHORT }}" >> $GITHUB_OUTPUT
# 0.0.1-a7-1tr5hrt
fi
- name: Update version number in chart.yaml
shell: bash
run: |
for chart in $(find charts -name Chart.yaml); do
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.RSSERVER_VERSION }}.0.0-${{ steps.get_version.outputs.SHA_SHORT }}," $chart
for chart in $(find charts -name Chart.yaml); do
sed -i "s,{{APP_VERSION}},${{ steps.get_version.outputs.APP_VERSION }}," $chart
sed -i "s,{{CHART_VERSION}},${{ steps.get_version.outputs.CHART_VERSION }}," $chart
done
- id: publish-chart
Expand Down
2 changes: 1 addition & 1 deletion charts/mockup-station-adgs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
appVersion: {{APP_VERSION}}
description: MOCKUP STATION ADGS
name: mockup-station-adgs
version: {{CHART_VERSION}}
Expand Down
2 changes: 1 addition & 1 deletion charts/mockup-station-cadip/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
appVersion: {{APP_VERSION}}
description: MOCKUP STATION CADIP
name: mockup-station-cadip
version: {{CHART_VERSION}}
Expand Down
2 changes: 1 addition & 1 deletion charts/rs-server-adgs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
appVersion: {{APP_VERSION}}
description: RS SERVER ADGS
name: rs-server-adgs
version: {{CHART_VERSION}}
Expand Down
2 changes: 1 addition & 1 deletion charts/rs-server-cadip/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
appVersion: {{APP_VERSION}}
description: RS SERVER CADIP
name: rs-server-cadip
version: {{CHART_VERSION}}
Expand Down
2 changes: 1 addition & 1 deletion charts/rs-server-catalog-db/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
appVersion: {{APP_VERSION}}
description: RS SERVER CATALOG DB
name: rs-server-catalog-db
version: {{CHART_VERSION}}
Expand Down
2 changes: 1 addition & 1 deletion charts/rs-server-catalog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
appVersion: {{APP_VERSION}}
description: RS SERVER CATALOG
name: rs-server-catalog
version: {{CHART_VERSION}}
Expand Down
2 changes: 1 addition & 1 deletion charts/rs-server-frontend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
appVersion: {{APP_VERSION}}
description: RS SERVER FRONTEND
name: rs-server-frontend
version: {{CHART_VERSION}}
Expand Down

0 comments on commit 992641c

Please sign in to comment.