Skip to content

Commit

Permalink
feat(devops): automatically upgrade gosdk (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi authored Apr 12, 2022
1 parent 7e16431 commit 5e2b33c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/gosdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Upgrade 0Chain GoSDK"

concurrency:
group: "gosdk-${{ github.ref }}"
cancel-in-progress: true

on:
workflow_dispatch:
inputs:
gosdk:
description: 'The version of 0Chain GoSDK'
required: true

jobs:
create-pr:
runs-on: [self-hosted, build]
steps:
- name: Setup go 1.17
uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Checkout
uses: actions/checkout@v1

- name: Upgrade 0Chain GoSDK
run: |
echo "BRANCH=$(echo ${{github.event.inputs.gosdk}} | sed 's/\//-/g')" >> $GITHUB_ENV
go get github.com/0chain/gosdk@${{github.event.inputs.gosdk}}
go mod tidy
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
base: staging
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: upgrade GoSDK to ${{ github.event.inputs.gosdk }}
branch: gosdk-upgrade-${{ env.BRANCH }}
delete-branch: true
title: Upgrade 0Chain GoSDK to ${{ github.event.inputs.gosdk }}
body: |
0Chain GoSDK `${{ github.event.inputs.gosdk }}` is released.
see full changelog on https://github.com/0chain/gosdk/releases/tag/${{ github.event.inputs.gosdk }}
draft: false
reviewers: cnlangzi
labels: GoSDK
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.7.7-0.20220412012247-c7c16790c79e
github.com/0chain/gosdk v1.7.7-0.20220412103704-142f68992c6d
github.com/icza/bitio v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/cobra v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.7.7-0.20220412012247-c7c16790c79e h1:4NgilYcd0CXoDghH/c/YHOBJrF3RcdhcUKTSSB0v+Kw=
github.com/0chain/gosdk v1.7.7-0.20220412012247-c7c16790c79e/go.mod h1:Cch/iwYKdBMnwcsFm2x9hG4CLYTVChCRFqA1TKRmRXU=
github.com/0chain/gosdk v1.7.7-0.20220412103704-142f68992c6d h1:qlG5xpCd8SWaMpWpmu9RKpPMA2pFZoF/dcU6tvuF40Y=
github.com/0chain/gosdk v1.7.7-0.20220412103704-142f68992c6d/go.mod h1:Cch/iwYKdBMnwcsFm2x9hG4CLYTVChCRFqA1TKRmRXU=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4=
Expand Down

0 comments on commit 5e2b33c

Please sign in to comment.