-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: [email protected] <[email protected]>
- Loading branch information
1 parent
af1b510
commit 406eec3
Showing
3 changed files
with
163 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Chart OFED | ||
|
||
env: | ||
CHART_PATH: ofed-driver/chart | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: 'tag, sha, branch' | ||
required: true | ||
default: main | ||
push: | ||
tags: | ||
- ofed-driver-v[0-9]+.[0-9]+.[0-9]+ | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
get_info: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
chart_path: ${{ env.chart_path }} | ||
code_sha: ${{ env.code_sha }} | ||
steps: | ||
- name: Get information | ||
id: get_original_ref | ||
run: | | ||
echo '${{ toJSON(github) }}' | ||
if ${{ github.event_name == 'workflow_dispatch' }}; then | ||
echo "call by workflow_dispatch" | ||
echo "code_sha=${{ github.event.inputs.ref }}" >> $GITHUB_ENV | ||
echo "chart_path=${{ env.CHART_PATH }}" >> $GITHUB_ENV | ||
elif ${{ github.event_name == 'push' }} ; then | ||
echo "call by push tag" | ||
echo "code_sha=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
echo "chart_path=${{ env.CHART_PATH }}" >> $GITHUB_ENV | ||
else | ||
exit 1 | ||
fi | ||
call-workflow: | ||
needs: [get_info] | ||
uses: ./.github/workflows/callBuildImage.yaml | ||
with: | ||
code_sha: ${{ needs.get_info.outputs.code_sha }} | ||
chart_path: ${{ needs.get_info.outputs.chart_path }} | ||
secrets: inherit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Call Build Chart | ||
|
||
env: | ||
PR_LABEL: pr/release/robot_update_githubpage | ||
PR_REVIWER: weizhoublue | ||
MERGE_BRANCH: github_pages | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
chart_path: | ||
required: true | ||
type: string | ||
code_sha: | ||
required: true | ||
type: string | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
package_chart: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
code_sha: ${{ env.code_sha }} | ||
steps: | ||
- name: Get information | ||
run: | | ||
echo '${{ toJSON(github) }}' | ||
if ${{ inputs.ref != '' }}; then | ||
echo "code_sha=${{ inputs.code_sha }}" >> $GITHUB_ENV | ||
echo "chart_path=${{ inputs.chart_path }}" >> $GITHUB_ENV | ||
else | ||
eixt 1 | ||
fi | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.code_sha }} | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@v4 | ||
#with: | ||
# version: ${{ env.HELM_VERSION }} | ||
|
||
- name: Package Chart | ||
continue-on-error: false | ||
run: | | ||
helm package ${{ env.chart_path }} | ||
if ! ls *.tgz &>/dev/null ; then | ||
echo "failed to generate chart" | ||
exit 1 | ||
fi | ||
mkdir -p tmp | ||
mv *.tgz tmp | ||
- name: Upload Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: chart_package_artifact | ||
path: tmp/* | ||
retention-days: 1 | ||
if-no-files-found: error | ||
|
||
# update /index.yaml in the target branch | ||
update_githubpage: | ||
runs-on: ubuntu-latest | ||
needs: [package_chart] | ||
steps: | ||
- name: Get Base Chart URL | ||
id: get_base_url | ||
run: | | ||
name=${{ github.repository }} | ||
proj=${name#*/} | ||
url=https://${{ github.repository_owner }}.github.io/${proj} | ||
echo "URL=${url}" >> $GITHUB_ENV | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.MERGE_BRANCH }} | ||
persist-credentials: "true" | ||
|
||
- name: Download Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: chart_package_artifact | ||
path: charts/ | ||
|
||
- name: Update Chart Yaml | ||
run: | | ||
helm repo index ./charts --url ${{ env.URL }}/charts | ||
mv ./charts/index.yaml ./index.yaml | ||
- uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/[email protected] | ||
with: | ||
title: "robot Update chart from ${{ needs.get_ref.outputs.code_sha }} to branch ${{ env.MERGE_BRANCH }} " | ||
commit-message: "robot Update chart from ${{ needs.get_ref.outputs.code_sha }} to branch ${{ env.MERGE_BRANCH }} " | ||
branch-suffix: timestamp | ||
branch: robot/update_chart | ||
committer: ty-dc <[email protected]> | ||
delete-branch: true | ||
base: ${{ env.MERGE_BRANCH }} | ||
signoff: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: ${{ env.PR_LABEL }} | ||
reviewers: ${{ env.PR_REVIWER }} |