Skip to content

Commit fb81559

Browse files
Automatic PR creation with clangrt
1 parent 216cd65 commit fb81559

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

.github/workflows/build_clangrt_builtins.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
name: Build clang runtime builtins
2+
23
on:
34
workflow_dispatch:
5+
inputs:
6+
target_sdk_branch:
7+
type: string
8+
required: false
9+
default: 'master'
10+
create_pr:
11+
type: boolean
12+
required: false
13+
default: false
14+
415
# TODO: remove this next line before merging!
516
push:
617

18+
env:
19+
GIT_USER_EMAIL: '[email protected]'
20+
GIT_USER_NAME: 'SDKLibsUpdaterGithub'
21+
UPDATE_BRANCH: 'sdk_libs_update'
22+
723
jobs:
824
build:
925
runs-on: ubuntu-latest
@@ -22,7 +38,7 @@ jobs:
2238
- uses: actions/checkout@v4
2339
with:
2440
# TODO: remove this next line before merging!
25-
ref: feat/apa/clangrt
41+
ref: feat/regain_control_over_libs
2642
sparse-checkout: |
2743
tools/build_clangrt_builtins.sh
2844
sparse-checkout-cone-mode: false
@@ -43,3 +59,34 @@ jobs:
4359
name: arch
4460
pattern: arch-*
4561
delete-merged: true
62+
63+
pr_create:
64+
needs: merge
65+
runs-on: ubuntu-latest
66+
if: ${{ success() && inputs.create_pr }}
67+
continue-on-error: true
68+
steps:
69+
- name: Clone repository
70+
uses: actions/checkout@v4
71+
with:
72+
# by default the action uses fetch-depth = 1, which creates
73+
# shallow repositories from which we can't push
74+
fetch-depth: 0
75+
ref: ${{ inputs.target_sdk_branch }}
76+
77+
- name: Download Binaries artifact
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: arch
81+
82+
- name: PR creation
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
run: |
86+
git config --global user.email ${{ env.GIT_USER_EMAIL }}
87+
git config --global user.name ${{ env.GIT_USER_NAME }}
88+
git switch --create ${{ env.UPDATE_BRANCH }}
89+
git add -A .
90+
git commit -m 'Updating static SDK libraries'
91+
git push -u origin ${{ env.UPDATE_BRANCH }}
92+
gh pr create -B ${{ inputs.target_sdk_branch }} --title '[SDK_LIBS_UPDATE] Updating static SDK libraries' --body 'Created by Github workflow "${{ github.workflow }}", job "${{ github.job }}", run "${{ github.run_id }}".'

0 commit comments

Comments
 (0)