Skip to content

Commit 9d50dd6

Browse files
authored
Merge pull request #617 from PragalvaXFREZ/feat/bump-versions-in-dependent-repos
[CI] Add workflow to bump schema version in Meshery and Meshkit on release
2 parents cf93502 + 045e015 commit 9d50dd6

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Bump Meshery and Meshkit
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: "Release Version (e.g. 0.8.125)"
8+
required: true
9+
default: "0.8.0"
10+
type: string
11+
release:
12+
types: [published]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
resolve-version:
19+
runs-on: ubuntu-24.04
20+
outputs:
21+
release_version: ${{ steps.resolve.outputs.release_version }}
22+
steps:
23+
- name: Resolve release version
24+
id: resolve
25+
env:
26+
INPUT_RELEASE_VERSION: ${{ github.event.inputs.release_version }}
27+
RELEASE_TAG: ${{ github.event.release.tag_name }}
28+
run: |
29+
set -eo pipefail
30+
31+
release_version="${INPUT_RELEASE_VERSION:-$RELEASE_TAG}"
32+
release_version="${release_version#v}"
33+
34+
if [ -z "$release_version" ]; then
35+
echo "Release version could not be determined." >&2
36+
exit 1
37+
fi
38+
39+
if ! [[ "$release_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
40+
echo "Invalid semver: $release_version" >&2
41+
exit 1
42+
fi
43+
44+
echo "release_version=$release_version" >> "$GITHUB_OUTPUT"
45+
echo "Resolved release version: $release_version"
46+
47+
bump-meshery:
48+
runs-on: ubuntu-24.04
49+
needs: resolve-version
50+
if: ${{ needs.resolve-version.outputs.release_version != '' }}
51+
env:
52+
RELEASE_VERSION: ${{ needs.resolve-version.outputs.release_version }}
53+
steps:
54+
- name: Checkout Meshery
55+
uses: actions/checkout@v6
56+
with:
57+
repository: meshery/meshery
58+
fetch-depth: 1
59+
token: ${{ secrets.GH_ACCESS_TOKEN }}
60+
- name: Set up Go
61+
uses: actions/setup-go@v6
62+
with:
63+
go-version-file: go.mod
64+
cache: true
65+
- name: Bump schemas dependency
66+
run: |
67+
go get "github.com/meshery/schemas@v${{ env.RELEASE_VERSION }}"
68+
go mod tidy
69+
- name: Create Pull Request
70+
uses: peter-evans/create-pull-request@v8
71+
with:
72+
token: ${{ secrets.GH_ACCESS_TOKEN }}
73+
commit-message: "chore: bump github.com/meshery/schemas to v${{ env.RELEASE_VERSION }}"
74+
committer: l5io <ci@meshery.io>
75+
author: l5io <ci@meshery.io>
76+
signoff: true
77+
branch: bump-schemas-bot
78+
delete-branch: true
79+
title: "[Chore]: Bump meshery/schemas to v${{ env.RELEASE_VERSION }}"
80+
add-paths: |
81+
go.mod
82+
go.sum
83+
body: |
84+
Bump `github.com/meshery/schemas` to v${{ env.RELEASE_VERSION }}
85+
86+
_This pull request has been auto-generated by [l5io](https://github.com/l5io)_
87+
assignees: l5io
88+
draft: false
89+
90+
bump-meshkit:
91+
runs-on: ubuntu-24.04
92+
needs: resolve-version
93+
if: ${{ needs.resolve-version.outputs.release_version != '' }}
94+
env:
95+
RELEASE_VERSION: ${{ needs.resolve-version.outputs.release_version }}
96+
steps:
97+
- name: Checkout Meshkit
98+
uses: actions/checkout@v6
99+
with:
100+
repository: meshery/meshkit
101+
fetch-depth: 1
102+
token: ${{ secrets.GH_ACCESS_TOKEN }}
103+
- name: Set up Go
104+
uses: actions/setup-go@v6
105+
with:
106+
go-version-file: go.mod
107+
cache: true
108+
- name: Bump schemas dependency
109+
run: |
110+
go get "github.com/meshery/schemas@v${{ env.RELEASE_VERSION }}"
111+
go mod tidy
112+
- name: Create Pull Request
113+
uses: peter-evans/create-pull-request@v8
114+
with:
115+
token: ${{ secrets.GH_ACCESS_TOKEN }}
116+
commit-message: "chore: bump github.com/meshery/schemas to v${{ env.RELEASE_VERSION }}"
117+
committer: l5io <ci@meshery.io>
118+
author: l5io <ci@meshery.io>
119+
signoff: true
120+
branch: bump-schemas-bot
121+
delete-branch: true
122+
title: "[Chore]: Bump meshery/schemas to v${{ env.RELEASE_VERSION }}"
123+
add-paths: |
124+
go.mod
125+
go.sum
126+
body: |
127+
Bump `github.com/meshery/schemas` to v${{ env.RELEASE_VERSION }}
128+
129+
_This pull request has been auto-generated by [l5io](https://github.com/l5io)_
130+
assignees: l5io
131+
draft: false

0 commit comments

Comments
 (0)