Skip to content

Commit 7d6fe5a

Browse files
committed
feat(ci): add more assets in release
- sample of the mysqluser - package of the operator chart fix: #616
1 parent 0d50643 commit 7d6fe5a

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.github/workflows/publish_charts.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
version:
77
required: true
88
type: string
9+
upload_url:
10+
required: true
11+
type: string
912

1013
jobs:
1114
build:
@@ -22,9 +25,11 @@ jobs:
2225
version: v3.6.3
2326

2427
- name: Modify chart version
28+
id: chart_version
2529
run: |
2630
input=${{ inputs.version }}
2731
chart_version=${input#*v}
32+
echo "::set-output name=asset_name::mysql-operator-$chart_version.tgz"
2833
sed -i "/^version:*/cversion: $chart_version" ./charts/mysql-operator/Chart.yaml
2934
3035
- name: Modify appVersion
@@ -38,10 +43,20 @@ jobs:
3843
- name: Packaging the chart
3944
run: helm package ./charts/mysql-operator/
4045

46+
- name: Upload asset
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ inputs.upload_url }}
52+
asset_path: ./${{ steps.chart_version.outputs.asset_name }}
53+
asset_name: ${{ steps.chart_version.outputs.asset_name }}
54+
asset_content_type: application/gzip
55+
4156
- uses: actions/upload-artifact@v2
4257
with:
4358
name: mysql-operator-chart
44-
path: ./mysql-operator-*.tgz
59+
path: ./${{ steps.chart_version.outputs.asset_name }}
4560
retention-days: 1
4661

4762
publish:

.github/workflows/publish_release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ jobs:
4040
needs: update_release_draft
4141
with:
4242
version: ${{ needs.update_release_draft.outputs.version }}
43+
upload_url: ${{ needs.update_release_draft.outputs.upload_url }}

.github/workflows/release_drafter.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ on:
1515
version:
1616
description: "The release version"
1717
value: ${{ jobs.update_release_draft.outputs.version }}
18+
upload_url:
19+
description: "The URL of uploading assets"
20+
value: ${{ jobs.update_release_draft.outputs.upload_url }}
21+
1822
jobs:
1923
update_release_draft:
2024
runs-on: ubuntu-latest
2125
outputs:
2226
version: ${{ steps.draft.outputs.tag_name }}
27+
upload_url: ${{ steps.draft.outputs.upload_url }}
2328
steps:
2429
- name: Checkout code
2530
uses: actions/checkout@v2
@@ -58,3 +63,13 @@ jobs:
5863
asset_path: ./config/samples/mysql_v1alpha1_mysqlcluster_mysql8.yaml
5964
asset_name: mysql_v1alpha1_mysqlcluster_mysql8.yaml
6065
asset_content_type: application/x-yaml
66+
67+
- name: Upload mysqluser sample yaml
68+
uses: actions/upload-release-asset@v1
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.git_token }}
71+
with:
72+
upload_url: ${{ steps.draft.outputs.upload_url }}
73+
asset_path: ./config/samples/mysql_v1alpha1_mysqluser.yaml
74+
asset_name: mysql_v1alpha1_mysqluser.yaml
75+
asset_content_type: application/x-yaml

0 commit comments

Comments
 (0)