Skip to content

Commit

Permalink
Merge pull request radondb#618 from runkecheng/ci_assets
Browse files Browse the repository at this point in the history
ci: add more assets in release
  • Loading branch information
acekingke authored Jul 26, 2022
2 parents 48e4116 + 3c7812b commit daf656b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/publish_charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
version:
required: true
type: string
upload_url:
required: true
type: string

jobs:
build:
Expand All @@ -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
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:

jobs:
build_operator:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_operator_image.yml@main
uses: ./.github/workflows/build_operator_image.yml
if: ${{ github.event.inputs.build_operator == 'true' }}
with:
image_tag: ${{ github.event.inputs.tag }}
Expand All @@ -34,7 +34,7 @@ jobs:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build_sidecar:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_sidecar_image.yml@main
uses: ./.github/workflows/build_sidecar_image.yml
if: ${{ github.event.inputs.build_sidecar == 'true' }}
with:
image_tag: ${{ github.event.inputs.tag }}
Expand All @@ -43,7 +43,7 @@ jobs:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build_xenon:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_xenon_image.yml@main
uses: ./.github/workflows/build_xenon_image.yml
if: ${{ github.event.inputs.build_xenon == 'true' }}
with:
image_tag: ${{ github.event.inputs.tag }}
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ on:

jobs:
update_release_draft:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/release_drafter.yml@main
uses: ./.github/workflows/release_drafter.yml
with:
version: ${{ github.event.inputs.version }}
secrets:
git_token: ${{ secrets.GITHUB_TOKEN }}

build_operator:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_operator_image.yml@main
uses: ./.github/workflows/build_operator_image.yml
needs: update_release_draft
with:
image_tag: ${{ needs.update_release_draft.outputs.version }}
Expand All @@ -26,7 +26,16 @@ jobs:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build_sidecar:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/build_sidecar_image.yml@main
uses: ./.github/workflows/build_sidecar_image.yml
needs: update_release_draft
with:
image_tag: ${{ needs.update_release_draft.outputs.version }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build_xenon:
uses: ./.github/workflows/build_xenon_image.yml
needs: update_release_draft
with:
image_tag: ${{ needs.update_release_draft.outputs.version }}
Expand All @@ -35,8 +44,9 @@ jobs:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

publish_chart:
uses: radondb/radondb-mysql-kubernetes/.github/workflows/publish_charts.yml@main
uses: ./.github/workflows/publish_charts.yml
if: ${{ github.event.inputs.version == '' }}
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
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit daf656b

Please sign in to comment.