Skip to content

Commit 7a98100

Browse files
authored
Merge pull request #795 from jerensl/ci/auto-bump-wait-on-release-npm
Ci/auto bump wait on release npm
2 parents 4fb353a + 41f323d commit 7a98100

File tree

2 files changed

+61
-14
lines changed

2 files changed

+61
-14
lines changed

.github/workflows/bump-meshery-version.yml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
name: Bump Meshery, Meshery Extensions and Meshery Cloud
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_run:
5+
workflows: [Publish Node.js Package]
6+
types:
7+
- completed
68

79
jobs:
10+
versions-check:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
current: ${{ steps.current.outputs.VERSION }}
14+
steps:
15+
- name: Download Version
16+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
17+
with:
18+
name: e2e-test-reporter
19+
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
20+
run-id: ${{ github.event.workflow_run.id }}
21+
- name: Retrieve Version
22+
run: |
23+
echo "VERSION=$(cat ./version/number)" >> $GITHUB_OUTPUT
24+
id: current
825
bump-meshery:
926
runs-on: ubuntu-latest
27+
needs: versions-check
1028
steps:
1129
- name: Checkout Meshery code
1230
uses: actions/checkout@v4
@@ -21,30 +39,31 @@ jobs:
2139
cache-dependency-path: '**/package-lock.json'
2240
- name: Make changes to pull request
2341
working-directory: ui
24-
run: npm install @layer5/sistent@latest
42+
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}}
2543
- name: Create Pull Request
2644
id: cpr
2745
uses: peter-evans/create-pull-request@v7
2846
with:
2947
token: ${{ secrets.RELEASEDRAFTER_PAT }}
30-
commit-message: Bump sistent ${{ github.event.release.tag_name }} dependencies
48+
commit-message: Bump sistent v${{ needs.versions-check.outputs.current }} dependencies
3149
committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
3250
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
3351
signoff: true
3452
branch: bump-sistent-bot
3553
delete-branch: true
36-
title: '[Chore]: Bump ${{ github.event.release.name }}'
54+
title: '[Chore]: Bump v${{ needs.versions-check.outputs.current }}'
3755
add-paths: |
3856
ui/package.json
3957
ui/package-lock.json
4058
body: |
41-
Update to Sistent ${{ github.event.release.tag_name }}
59+
Update to Sistent v${{ needs.versions-check.outputs.current }}
4260
4361
_This pull request has been auto-generated by [l5io](http://github.com/l5io)_
4462
assignees: l5io
4563
draft: false
4664
bump-meshery-extensions:
4765
runs-on: ubuntu-latest
66+
needs: versions-check
4867
steps:
4968
- name: Checkout Meshery Extensions code
5069
uses: actions/checkout@v4
@@ -59,30 +78,31 @@ jobs:
5978
cache-dependency-path: '**/package-lock.json'
6079
- name: Make changes to pull request
6180
working-directory: meshmap
62-
run: npm install @layer5/sistent@latest
81+
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}}
6382
- name: Create Pull Request
6483
id: cpr
6584
uses: peter-evans/create-pull-request@v7
6685
with:
6786
token: ${{ secrets.RELEASEDRAFTER_PAT }}
68-
commit-message: Bump sistent ${{ github.event.release.tag_name }} dependencies
87+
commit-message: Bump sistent v${{ needs.versions-check.outputs.current }} dependencies
6988
committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
7089
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
7190
signoff: true
7291
branch: bump-sistent-bot
7392
delete-branch: true
74-
title: '[Chore]: Bump ${{ github.event.release.name }}'
93+
title: '[Chore]: Bump v${{needs.versions-check.outputs.current }}'
7594
add-paths: |
7695
meshmap/package.json
7796
meshmap/package-lock.json
7897
body: |
79-
Update to Sistent ${{ github.event.release.tag_name }}
98+
Update to Sistent v${{ needs.versions-check.outputs.current }}
8099
81100
_This pull request has been auto-generated by [l5io](http://github.com/l5io)_
82101
assignees: l5io
83102
draft: false
84103
bump-meshery-cloud:
85104
runs-on: ubuntu-latest
105+
needs: versions-check
86106
steps:
87107
- name: Checkout Meshery Extensions code
88108
uses: actions/checkout@v4
@@ -97,24 +117,24 @@ jobs:
97117
cache-dependency-path: '**/package-lock.json'
98118
- name: Make changes to pull request
99119
working-directory: ui
100-
run: npm install @layer5/sistent@latest
120+
run: npm install @layer5/sistent@${{needs.versions-check.outputs.current}}
101121
- name: Create Pull Request
102122
id: cpr
103123
uses: peter-evans/create-pull-request@v7
104124
with:
105125
token: ${{ secrets.RELEASEDRAFTER_PAT }}
106-
commit-message: Bump sistent ${{ github.event.release.tag_name }} dependencies
126+
commit-message: Bump sistent v${{ needs.versions-check.outputs.current }} dependencies
107127
committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
108128
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
109129
signoff: true
110130
branch: bump-sistent-bot
111131
delete-branch: true
112-
title: '[Chore]: Bump ${{ github.event.release.name }}'
132+
title: '[Chore]: Bump v${{ needs.versions-check.outputs.current }}'
113133
add-paths: |
114134
ui/package.json
115135
ui/package-lock.json
116136
body: |
117-
Update to Sistent ${{ github.event.release.tag_name }}
137+
Update to Sistent v${{ needs.versions-check.outputs.current }}
118138
119139
_This pull request has been auto-generated by [l5io](http://github.com/l5io)_
120140
assignees: l5io

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,30 @@ jobs:
4444
npm publish --verbose
4545
env:
4646
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
versions-check:
48+
needs: publish-gpr
49+
runs-on: ubuntu-latest
50+
outputs:
51+
current: ${{ steps.versions.outputs }}
52+
steps:
53+
- uses: actions/github-script@v7
54+
id: versions
55+
with:
56+
result-encoding: string
57+
script: |
58+
let str = "${{github.event.release.tag_name}}"
59+
60+
return str.replace(/^v/, '')
61+
- name: Save Release number
62+
if: ${{ !cancelled() }}
63+
run: |
64+
mkdir -p ./version
65+
echo ${{ steps.versions.outputs }} > ./version/number
66+
- name: Upload Version Report
67+
if: ${{ !cancelled() }}
68+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
69+
with:
70+
name: version-number
71+
path: |
72+
version/number
73+
retention-days: 14

0 commit comments

Comments
 (0)