2023-11-08 12:27:37 +00:00
|
|
|
name: 4testing multiarch-cron-build
|
2023-10-12 08:21:00 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2023-11-08 12:27:37 +00:00
|
|
|
- cron: '0 20 * * *'
|
2023-10-12 08:21:00 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-10-19 10:31:07 +00:00
|
|
|
|
|
|
|
select-branches:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out the code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: List Branches
|
|
|
|
id: list-branches
|
|
|
|
run: |
|
2023-11-08 12:27:37 +00:00
|
|
|
all_branches=$(git ls-remote -hq | sed -n 's/^[0-9a-f]\{40\}\s\+refs\/heads\//''/p')
|
2023-10-19 10:31:07 +00:00
|
|
|
matching_branches=""
|
|
|
|
|
|
|
|
for branch in $all_branches; do
|
|
|
|
if [[ $branch =~ ^release/v[0-9]+ || $branch =~ ^hotfix/v[0-9]+ || $branch == "develop" ]]; then
|
|
|
|
matching_branches="${matching_branches},\"${branch}\""
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
matching_branches=${matching_branches#,}
|
|
|
|
echo "json_output=[${matching_branches}]" >> $GITHUB_OUTPUT
|
|
|
|
|
2024-02-27 12:08:20 +00:00
|
|
|
last_branch=$(echo ${matching_branches} | awk -F, '{print $NF}' | sed 's/"//g')
|
|
|
|
echo "last_branch=${last_branch}" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-11-08 12:27:37 +00:00
|
|
|
- name: Dispatch Action
|
2023-10-12 08:21:00 +00:00
|
|
|
run: |
|
2023-11-08 12:27:37 +00:00
|
|
|
echo "${{ steps.list-branches.outputs.json_output }}"
|
|
|
|
|
2023-11-10 08:17:48 +00:00
|
|
|
curl \
|
|
|
|
-X POST \
|
2023-11-08 12:27:37 +00:00
|
|
|
-u "${{ secrets.USERNAME}}:${{secrets.TOKEN}}" \
|
|
|
|
"https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/dispatches" \
|
|
|
|
-H "Accept: application/vnd.github.everest-preview+json" \
|
|
|
|
--data '{"event_type": "cron-trigger-action", "client_payload": { "branches": ${{ steps.list-branches.outputs.json_output }}}}'
|
2024-02-27 12:08:20 +00:00
|
|
|
|
|
|
|
curl \
|
|
|
|
-X POST \
|
|
|
|
-u "${{ secrets.USERNAME}}:${{secrets.TOKEN}}" \
|
|
|
|
https://api.github.com/repos/ONLYOFFICE/DocSpace/actions/workflows/59268961/dispatches \
|
|
|
|
-H "Accept: application/vnd.github.everest-preview+json" \
|
|
|
|
--data '{
|
|
|
|
"ref": "${{ steps.list-branches.outputs.last_branch }}",
|
|
|
|
"inputs": {
|
|
|
|
"branch-buildtools": "${{ steps.list-branches.outputs.last_branch }}",
|
|
|
|
"branch-client": "${{ steps.list-branches.outputs.last_branch }}",
|
|
|
|
"branch-server": "${{ steps.list-branches.outputs.last_branch }}"
|
|
|
|
}
|
|
|
|
}'
|