Skip to content

Commit 09d604a

Browse files
authored
feat(devops): automatically upgrade gosdk (#633)
1 parent aad9ea2 commit 09d604a

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/gosdk.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Upgrade 0Chain GoSDK"
2+
3+
concurrency:
4+
group: "gosdk-${{ github.ref }}"
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
gosdk:
11+
description: 'The version of 0Chain GoSDK'
12+
required: true
13+
14+
jobs:
15+
create-pr:
16+
runs-on: [self-hosted, build]
17+
steps:
18+
- name: Setup go 1.17
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: '1.17'
22+
23+
- name: Checkout
24+
uses: actions/checkout@v1
25+
26+
- name: Upgrade 0Chain GoSDK
27+
run: |
28+
echo "BRANCH=$(echo ${{github.event.inputs.gosdk}} | sed 's/\//-/g')" >> $GITHUB_ENV
29+
30+
go get github.com/0chain/gosdk@${{github.event.inputs.gosdk}}
31+
go mod tidy
32+
33+
- name: Create Pull Request
34+
uses: peter-evans/create-pull-request@v3
35+
with:
36+
base: staging
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
commit-message: upgrade GoSDK to ${{ github.event.inputs.gosdk }}
39+
branch: gosdk-upgrade-${{ env.BRANCH }}
40+
delete-branch: true
41+
title: Upgrade 0Chain GoSDK to ${{ github.event.inputs.gosdk }}
42+
body: |
43+
0Chain GoSDK `${{ github.event.inputs.gosdk }}` is released.
44+
see full changelog on https://github.com/0chain/gosdk/releases/tag/${{ github.event.inputs.gosdk }}
45+
draft: false
46+
reviewers: cnlangzi
47+
labels: GoSDK

0 commit comments

Comments
 (0)