Skip to content

Commit

Permalink
Update cron-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
isboston committed Dec 14, 2024
1 parent c53eb96 commit 2ec4c5d
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/cron-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: 4testing multiarch-cron-build
on:
schedule:
- cron: '0 20 * * *'
push:
branches:
- 'feature/cron-build-oci'

jobs:

Expand All @@ -26,7 +29,11 @@ jobs:
echo "$all_branches" | grep '^develop$'
} | sed 's/^/"/; s/$/"/'
)
echo "json_output=[${matching_branches//$'\n'/,}]" >> $GITHUB_OUTPUT
json_output="[${matching_branches//$'\n'/, }]"
json_output="${json_output//\"/\\\"}"
echo "json_output=$json_output" >> $GITHUB_OUTPUT
echo "branches=${matching_branches//$'\n'/ }" | tr -d '[]\"' >> $GITHUB_OUTPUT
- name: Determine Priority Branch
Expand All @@ -48,19 +55,30 @@ jobs:
echo "build_deb=$(echo "${CHANGED_FILES}" | grep -qE '^install/common/|^install/deb/' && echo true || echo false)" >> $GITHUB_OUTPUT
echo "build_rpm=$(echo "${CHANGED_FILES}" | grep -qE '^install/common/|^install/rpm/' && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Dispatch Action main build
run: |
branches_json='${{ steps.list-branches.outputs.json_output }}'
json_payload=$(jq -n \
--arg ref "feature/cron-build-oci" \
--arg branches "$branches_json" \
'{
ref: $ref,
inputs: {
branches: $branches
}
}')
echo "Payload for curl:"
echo "$json_payload" | jq .
curl \
-X POST \
-u "${{ secrets.USERNAME }}:${{ secrets.TOKEN }}" \
"https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/actions/workflows/75421046/dispatches" \
-H "Accept: application/vnd.github+json" \
--data '{
"ref": "'"${{ github.ref_name }}"'",
"inputs": {
"branches": "[\"develop\", \"hotfix/v3.0.1\", \"release/v3.0.0\"]"
}
}'
-H "Content-Type: application/json" \
--data "$json_payload"

- name: Dispatch Action build packages
if: ${{ github.event_name == 'schedule' && steps.priority.outputs.target_branch != '' && (steps.changes.outputs.build_deb == 'true' || steps.changes.outputs.build_rpm == 'true') }}
Expand Down

0 comments on commit 2ec4c5d

Please sign in to comment.