Skip to content

Commit dfab20d

Browse files
author
Rub21
committed
Update action for publish version of osm-seed
1 parent a9c1c55 commit dfab20d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/chartpress.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,24 @@ 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 jq
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=$(jq -r '.version' < package.json)
27+
echo "GIT_BRANCH_NAME=$GIT_BRANCH_NAME" >> $GITHUB_ENV
28+
echo "OSM_SEED_VERSION=$OSM_SEED_VERSION" >> $GITHUB_ENV
2229
- name: Run Chartpress
23-
run: chartpress --push --publish-chart
2430
env:
2531
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
26-
32+
GITHUB_EVENT_NAME: ${{ github.event_name }}
33+
run: |
34+
if [[ $GIT_BRANCH_NAME = "develop" && $GITHUB_EVENT_NAME = "push" ]]
35+
then
36+
chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}
37+
else
38+
chartpress --push --publish-chart
39+
fi

0 commit comments

Comments
 (0)