Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix "package" github action (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmessinger authored Dec 18, 2020
1 parent bec19fc commit 51b15fe
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,35 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v2
- name: package chart
- name: install dependencies
run: |
# install yq
pip install yq
export PATH="$PATH:/home/runner/.local/bin"
echo "::set-env name=PATH::$PATH"
echo "/home/runner/.local/bin" >> $GITHUB_PATH
# install jq
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
sudo mv jq-linux64 /usr/local/bin/jq
sudo chmod +x /usr/local/bin/jq
# install helm
HELM_VERSION=v2.16.9
wget http://storage.googleapis.com/kubernetes-helm/helm-${HELM_VERSION}-linux-amd64.tar.gz
tar -xvf helm-${HELM_VERSION}-linux-amd64.tar.gz
sudo mv linux-amd64/helm /usr/local/bin/helm-${HELM_VERSION}
rm -f /helm-${HELM_VERSION}-linux-amd64.tar.gz
- name: package chart
run: |
# update chart version in Chart.yaml
CHART_VERSION="${{ github.ref }}"
CHART_VERSION=$(echo "${CHART_VERSION##*v}")
echo "::set-env name=CHART_VERSION::$CHART_VERSION"
echo "CHART_VERSION=$CHART_VERSION" >> $GITHUB_ENV
pushd pgbouncer
cat Chart.yaml | yq -y --arg VERSION "$CHART_VERSION" '.version = $VERSION' > Chart.yaml.tmp
mv Chart.yaml.tmp Chart.yaml
popd
# package the chart
helm package pgbouncer
Expand Down Expand Up @@ -79,6 +80,9 @@ jobs:
mv index.yaml.tmp index.yaml
popd
# update the README
sed -i "s/version: [[:digit:]].[[:digit:]].[[:digit:]]/version: ${{ env.CHART_VERSION }}/" README.md
# push index.yaml and Chart.yaml for this release; these commits will trail the "tag".
git config --global user.name 'github actions'
git config --global user.email 'github-actions@users.noreply.github.com'
Expand Down

0 comments on commit 51b15fe

Please sign in to comment.