Skip to content

Commit d39b522

Browse files
authored
fix(ci): update publish script (#8)
1 parent 579240f commit d39b522

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.github/workflows/publish-charts.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
jobs:
77
publish-charts:
88
runs-on: ubuntu-latest
9+
if: github.repository == 'aws/eks-node-monitoring-agent'
910
steps:
10-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
11+
- name: "Checkout"
12+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
1113
with:
12-
ref: 'main'
14+
fetch-depth: 0
1315
- name: "Setup Helm"
1416
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # 4.3.0
1517
- name: "Publish Charts"

hack/publish-charts.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@ VERSION=$(git describe --tags --always)
77
STAGING_DIR=${1:-${GIT_REPO_ROOT}}
88
CHART_URL=${2:-https://aws.github.io/eks-node-monitoring-agent}
99

10+
git fetch --all
11+
git config user.email [email protected]
12+
git config user.name eks-bot
13+
1014
helm package ${GIT_REPO_ROOT}/charts/* --destination ${STAGING_DIR} --dependency-update
15+
16+
for bundle in ${STAGING_DIR}/*.tgz; do
17+
if git cat-file -e origin/gh-pages:${bundle}; then
18+
echo "⏩ Release already exists for ${bundle}"
19+
rm -f ${bundle}
20+
fi
21+
done
22+
23+
if ! ls ${STAGING_DIR}/*.tgz; then
24+
echo "⏩ No changes to be staged"
25+
exit 0
26+
fi
27+
1128
git checkout gh-pages
1229
mv ${STAGING_DIR}/*.tgz .
1330
helm repo index . --url ${CHART_URL}

0 commit comments

Comments
 (0)