Skip to content

Commit

Permalink
Add chart action into release
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Qiu <[email protected]>
  • Loading branch information
qiujian16 committed Jul 29, 2024
1 parent 6c4292b commit 8858ea0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ jobs:
run: |
python hack/changelog.py ${{ secrets.GITHUB_TOKEN }} ${{ needs.env.outputs.RELEASE_VERSION }} > /home/runner/work/changelog.txt
cat /home/runner/work/changelog.txt
- name: setup helm
uses: azure/setup-helm@v1
- name: chart package
run: |
mkdir -p release
pushd release
helm package ../deploy/cluster-manager/chart/cluster-manager
helm package ../deploy/klusterlet/chart/klusterlet
popd
- name: publish release
if: github.event_name != 'pull_request'
uses: softprops/action-gh-release@v2
Expand All @@ -71,3 +80,49 @@ jobs:
body_path: /home/runner/work/changelog.txt
draft: true
generate_release_notes: true
files: |
release/*.tgz
- name: submit cluster-manager chart to OCM chart repo
uses: actions/github-script@v6
with:
github-token: ${{ secrets.OCM_BOT_PAT }}
script: |
try {
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'open-cluster-management-io',
repo: 'helm-charts',
workflow_id: 'download-chart.yml',
ref: 'main',
inputs: {
repo: "${{ github.repository }}",
version: "${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }}",
"chart-name": "cluster-manager",
},
})
console.log(result);
} catch(error) {
console.error(error);
core.setFailed(error);
}
- name: submit klusterlet chart to OCM chart repo
uses: actions/github-script@v6
with:
github-token: ${{ secrets.OCM_BOT_PAT }}
script: |
try {
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'open-cluster-management-io',
repo: 'helm-charts',
workflow_id: 'download-chart.yml',
ref: 'main',
inputs: {
repo: "${{ github.repository }}",
version: "${{ needs.env.outputs.TRIMMED_RELEASE_VERSION }}",
"chart-name": "klusterlet",
},
})
console.log(result);
} catch(error) {
console.error(error);
core.setFailed(error);
}
2 changes: 1 addition & 1 deletion .github/workflows/releaseimage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GoRelease
name: ImageRelease

on:
push:
Expand Down

0 comments on commit 8858ea0

Please sign in to comment.