-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gh workflow for updating clarity-js-sdk
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
## | ||
## Auto-opens a PR on the clarity-js-sdk repo to update the binary reference when a new release is published. | ||
## | ||
|
||
name: Open Clarity JS SDK PR | ||
|
||
env: | ||
CLARITY_JS_SDK_REPOSITORY: blockstack/clarity-js-sdk | ||
COMMIT_USER: Hiro DevOps | ||
COMMIT_EMAIL: 45208873+blockstack-devops@users.noreply.github.com | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout latest clarity js sdk | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
repository: ${{ env.CLARITY_JS_SDK_REPOSITORY }} | ||
ref: master | ||
|
||
- name: Determine Release Version | ||
run: | | ||
RELEASE_VERSION=$(echo ${GITHUB_REF#refs/*/} | tr / -) | ||
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | ||
echo "UPDATE_BRANCH=auto/update-bin-$RELEASE_VERSION" >> $GITHUB_ENV | ||
- name: Update SDK Tag | ||
run: sed -i "s@CORE_SDK_TAG = \".*\"@CORE_SDK_TAG = \"$RELEASE_VERSION\"@g" packages/clarity-native-bin/src/index.ts | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
commit-message: Update clarity-native-bin tag | ||
committer: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}> | ||
author: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}> | ||
branch: ${{ env.UPDATE_BRANCH }} | ||
title: "clarity-native-bin tag update: ${{ env.RELEASE_VERSION }}" | ||
body: | | ||
:robot: This is an automated pull request created from a new release in [stacks-blockchain](https://github.com/blockstack/stacks-blockchain/releases). | ||
Updates the clarity-native-bin tag. | ||
assignees: zone117x,hstove | ||
reviewers: zone117x,hstove |