-
Notifications
You must be signed in to change notification settings - Fork 14
45 lines (41 loc) · 1.63 KB
/
Copy pathupdate_sdk_version.yml
File metadata and controls
45 lines (41 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Update HyP3 SDK version
on:
workflow_dispatch:
inputs:
sdk_version:
description: 'The new version of the SDK'
required: true
jobs:
bump_sdk_version:
name: Bump the SDK version
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v7
with:
token: ${{ secrets.TOOLS_BOT_PAK }}
- name: create patch branch
id: patch
env:
SDK_VERSION: ${{ github.event.inputs.sdk_version }}
PATCH_BRANCH: bump-sdk-${{ github.event.inputs.sdk_version }}
run: |
git config user.name "tools-bot"
git config user.email "UAF-asf-apd@alaska.edu"
echo "::set-output name=branch::${PATCH_BRANCH}"
git checkout -b ${PATCH_BRANCH}
sed -i -r "s|hyp3-sdk/v[0-9]+\.[0-9]+\.[0-9]+|hyp3-sdk/${SDK_VERSION}|" docs/using/sdk.md
sed -i -r "s|\`hyp3_sdk\` \*v[0-9]+\.[0-9]+\.[0-9]+\*|\`hyp3_sdk\` \*${SDK_VERSION}\*|" docs/using/sdk_api.md
sed -i -r "s|hyp3_sdk=[0-9]+\.[0-9]+\.[0-9]+|hyp3_sdk=${SDK_VERSION#v}|" environment.yml
git commit -am "Bump SDK version to ${SDK_VERSION}"
git push origin ${PATCH_BRANCH}
- name: open PR
env:
PR_TITLE: Update HyP3 SDK version to ${{ github.event.inputs.sdk_version }}
PR_BODY: PR created by a `workflow_dispatch` event
GH_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
run: |
gh pr create --title "${PR_TITLE}" \
--body "${PR_BODY}" \
--label tools-bot \
--head ${{ steps.patch.outputs.branch }} \
--base main