Skip to content

Commit 8a512b5

Browse files
authored
Merge pull request #618 from runkecheng/ci_assets
ci: add more assets in release
2 parents 8f05191 + be1dca0 commit 8a512b5

File tree

4 files changed

+48
-8
lines changed

4 files changed

+48
-8
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_images.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
jobs:
2727
build_operator:
28-
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_operator_image.yml@main
28+
uses: ./.github/workflows/build_operator_image.yml
2929
if: ${{ github.event.inputs.build_operator == 'true' }}
3030
with:
3131
image_tag: ${{ github.event.inputs.tag }}
@@ -34,7 +34,7 @@ jobs:
3434
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
3535

3636
build_sidecar:
37-
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_sidecar_image.yml@main
37+
uses: ./.github/workflows/build_sidecar_image.yml
3838
if: ${{ github.event.inputs.build_sidecar == 'true' }}
3939
with:
4040
image_tag: ${{ github.event.inputs.tag }}
@@ -43,7 +43,7 @@ jobs:
4343
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
4444

4545
build_xenon:
46-
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_xenon_image.yml@main
46+
uses: ./.github/workflows/build_xenon_image.yml
4747
if: ${{ github.event.inputs.build_xenon == 'true' }}
4848
with:
4949
image_tag: ${{ github.event.inputs.tag }}

.github/workflows/publish_release.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ on:
1010

1111
jobs:
1212
update_release_draft:
13-
uses: radondb/radondb-mysql-kubernetes/.github/workflows/release_drafter.yml@main
13+
uses: ./.github/workflows/release_drafter.yml
1414
with:
1515
version: ${{ github.event.inputs.version }}
1616
secrets:
1717
git_token: ${{ secrets.GITHUB_TOKEN }}
1818

1919
build_operator:
20-
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_operator_image.yml@main
20+
uses: ./.github/workflows/build_operator_image.yml
2121
needs: update_release_draft
2222
with:
2323
image_tag: ${{ needs.update_release_draft.outputs.version }}
@@ -26,7 +26,16 @@ jobs:
2626
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
2727

2828
build_sidecar:
29-
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_sidecar_image.yml@main
29+
uses: ./.github/workflows/build_sidecar_image.yml
30+
needs: update_release_draft
31+
with:
32+
image_tag: ${{ needs.update_release_draft.outputs.version }}
33+
secrets:
34+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
35+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
build_xenon:
38+
uses: ./.github/workflows/build_xenon_image.yml
3039
needs: update_release_draft
3140
with:
3241
image_tag: ${{ needs.update_release_draft.outputs.version }}
@@ -35,8 +44,9 @@ jobs:
3544
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
3645

3746
publish_chart:
38-
uses: radondb/radondb-mysql-kubernetes/.github/workflows/publish_charts.yml@main
47+
uses: ./.github/workflows/publish_charts.yml
3948
if: ${{ github.event.inputs.version == '' }}
4049
needs: update_release_draft
4150
with:
4251
version: ${{ needs.update_release_draft.outputs.version }}
52+
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)