Skip to content

Commit 6c548d6

Browse files
author
Ruben L. Mendoza
authored
Merge pull request #239 from developmentseed/versioning
Update action for publishing version for osm-seed charts
2 parents 49c50ae + b883257 commit 6c548d6

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.github/workflows/chartpress.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,29 @@ jobs:
1616
python-version: '3.6'
1717
- name: Setup git
1818
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
2020
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
2231
- name: Run Chartpress
23-
run: chartpress --push --publish-chart
2432
env:
2533
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

osm-seed/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
22
description: "Helm Chart to deploy the OpenStreetMap software"
33
name: osm-seed
4+
appVersion: 1.0.0
45
version: ''
5-

0 commit comments

Comments
 (0)