Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add more assets in release #618

Merged
merged 3 commits into from
Jul 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(ci): add more assets in release
- sample of the mysqluser
- package of the operator chart

fix: #616
  • Loading branch information
runkecheng committed Jul 25, 2022
commit 7d6fe5a1e250c0916c1057fcc1d3bcbe10c6e4da
17 changes: 16 additions & 1 deletion .github/workflows/publish_charts.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@ on:
version:
required: true
type: string
upload_url:
required: true
type: string

jobs:
build:
@@ -22,9 +25,11 @@ jobs:
version: v3.6.3

- name: Modify chart version
id: chart_version
run: |
input=${{ inputs.version }}
chart_version=${input#*v}
echo "::set-output name=asset_name::mysql-operator-$chart_version.tgz"
sed -i "/^version:*/cversion: $chart_version" ./charts/mysql-operator/Chart.yaml

- name: Modify appVersion
@@ -38,10 +43,20 @@ jobs:
- name: Packaging the chart
run: helm package ./charts/mysql-operator/

- name: Upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: ./${{ steps.chart_version.outputs.asset_name }}
asset_name: ${{ steps.chart_version.outputs.asset_name }}
asset_content_type: application/gzip

- uses: actions/upload-artifact@v2
with:
name: mysql-operator-chart
path: ./mysql-operator-*.tgz
path: ./${{ steps.chart_version.outputs.asset_name }}
retention-days: 1

publish:
1 change: 1 addition & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -40,3 +40,4 @@ jobs:
needs: update_release_draft
with:
version: ${{ needs.update_release_draft.outputs.version }}
upload_url: ${{ needs.update_release_draft.outputs.upload_url }}
15 changes: 15 additions & 0 deletions .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
@@ -15,11 +15,16 @@ on:
version:
description: "The release version"
value: ${{ jobs.update_release_draft.outputs.version }}
upload_url:
description: "The URL of uploading assets"
value: ${{ jobs.update_release_draft.outputs.upload_url }}

jobs:
update_release_draft:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.draft.outputs.tag_name }}
upload_url: ${{ steps.draft.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
@@ -58,3 +63,13 @@ jobs:
asset_path: ./config/samples/mysql_v1alpha1_mysqlcluster_mysql8.yaml
asset_name: mysql_v1alpha1_mysqlcluster_mysql8.yaml
asset_content_type: application/x-yaml

- name: Upload mysqluser sample yaml
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.git_token }}
with:
upload_url: ${{ steps.draft.outputs.upload_url }}
asset_path: ./config/samples/mysql_v1alpha1_mysqluser.yaml
asset_name: mysql_v1alpha1_mysqluser.yaml
asset_content_type: application/x-yaml