File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,29 @@ jobs:
16
16
python-version : ' 3.6'
17
17
- name : Setup git
18
18
run :
git config --global user.email "[email protected] " && git config --global user.name "Github Action"
19
- - name : Install Chartpress
19
+ - name : Install Chartpress and some python modules
20
20
run : |
21
- pip install -v chartpress && pip install six
21
+ pip install -v chartpress && pip install six && pip install yq
22
+ - name : Set env vars for publish charts
23
+ run : |
24
+ GIT_BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
25
+ GIT_BRANCH_NAME=${GIT_BRANCH_NAME/\//_}
26
+ OSM_SEED_VERSION=$(yq -r .appVersion ./osm-seed/Chart.yaml)
27
+ SHORT_GITHUB_SHA=${GITHUB_SHA::7}
28
+ echo "GIT_BRANCH_NAME=$GIT_BRANCH_NAME" >> $GITHUB_ENV
29
+ echo "OSM_SEED_VERSION=$OSM_SEED_VERSION" >> $GITHUB_ENV
30
+ echo "SHORT_GITHUB_SHA=$SHORT_GITHUB_SHA" >> $GITHUB_ENV
22
31
- name : Run Chartpress
23
- run : chartpress --push --publish-chart
24
32
env :
25
33
GITHUB_TOKEN : ${{ secrets.REPO_TOKEN }}
26
-
34
+ GITHUB_EVENT_NAME : ${{ github.event_name }}
35
+ run : |
36
+ if [[ $GIT_BRANCH_NAME = "main" ]]
37
+ then
38
+ chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}
39
+ elif [[ $GIT_BRANCH_NAME = "develop" ]]
40
+ then
41
+ chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}-dev.h$SHORT_GITHUB_SHA
42
+ else
43
+ chartpress --push --publish-chart
44
+ fi
Original file line number Diff line number Diff line change 1
1
apiVersion : v1
2
2
description : " Helm Chart to deploy the OpenStreetMap software"
3
3
name : osm-seed
4
+ appVersion : 1.0.0
4
5
version : ' '
5
-
You can’t perform that action at this time.
0 commit comments