Skip to content

Commit cdc5614

Browse files
authored
Merge pull request #2107 from blockstack/clarity-js-sdk-action
add gh workflow for updating clarity-js-sdk
2 parents e8f8144 + 36c6874 commit cdc5614

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
##
2+
## Auto-opens a PR on the clarity-js-sdk repo to update the binary reference when a new release is published.
3+
##
4+
5+
name: Open Clarity JS SDK PR
6+
7+
env:
8+
CLARITY_JS_SDK_REPOSITORY: blockstack/clarity-js-sdk
9+
COMMIT_USER: Hiro DevOps
10+
COMMIT_EMAIL: [email protected]
11+
on:
12+
release:
13+
types:
14+
- published
15+
16+
jobs:
17+
run:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout latest clarity js sdk
21+
uses: actions/checkout@v2
22+
with:
23+
token: ${{ secrets.GH_TOKEN }}
24+
repository: ${{ env.CLARITY_JS_SDK_REPOSITORY }}
25+
ref: master
26+
27+
- name: Determine Release Version
28+
run: |
29+
RELEASE_VERSION=$(echo ${GITHUB_REF#refs/*/} | tr / -)
30+
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
31+
echo "UPDATE_BRANCH=auto/update-bin-$RELEASE_VERSION" >> $GITHUB_ENV
32+
33+
- name: Update SDK Tag
34+
run: sed -i "s@CORE_SDK_TAG = \".*\"@CORE_SDK_TAG = \"$RELEASE_VERSION\"@g" packages/clarity-native-bin/src/index.ts
35+
36+
- name: Create Pull Request
37+
uses: peter-evans/create-pull-request@v3
38+
with:
39+
token: ${{ secrets.GH_TOKEN }}
40+
commit-message: Update clarity-native-bin tag
41+
committer: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}>
42+
author: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}>
43+
branch: ${{ env.UPDATE_BRANCH }}
44+
title: "clarity-native-bin tag update: ${{ env.RELEASE_VERSION }}"
45+
body: |
46+
:robot: This is an automated pull request created from a new release in [stacks-blockchain](https://github.com/blockstack/stacks-blockchain/releases).
47+
48+
Updates the clarity-native-bin tag.
49+
assignees: zone117x,hstove
50+
reviewers: zone117x,hstove

0 commit comments

Comments
 (0)