forked from radondb/radondb-mysql-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (67 loc) · 2.66 KB
/
release_drafter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Draft release
on:
workflow_call:
inputs:
version:
required: false
type: string
secrets:
git_token:
description: 'token of github'
required: true
outputs:
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
- name: Draft release
uses: release-drafter/release-drafter@v5
id: draft
with:
version: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
tag: ${{ github.event.inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.git_token }}
- name: Update version
run: |
sed -i '/^ sidecarImage: radondb\/mysql57-sidecar:*/c\ sidecarImage: radondb\/mysql57-sidecar:${{ steps.draft.outputs.tag_name }}' config/samples/mysql_v1alpha1_mysqlcluster.yaml
sed -i '/^ sidecarImage: radondb\/mysql80-sidecar:*/c\ sidecarImage: radondb\/mysql80-sidecar:${{ steps.draft.outputs.tag_name }}' config/samples/mysql_v1alpha1_mysqlcluster_mysql8.yaml
- name: Upload mysql57 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_mysqlcluster.yaml
asset_name: mysql_v1alpha1_mysqlcluster.yaml
asset_content_type: application/x-yaml
- name: Upload mysql80 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_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