Skip to content

Commit

Permalink
Testing download
Browse files Browse the repository at this point in the history
  • Loading branch information
vvolkgang committed Oct 1, 2024
1 parent 7198cca commit 6f4f2ae
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/actions/dispatch-and-download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,61 @@ runs:
run: |
echo ${{steps.return_dispatch.outputs.run_id}}
echo ${{steps.return_dispatch.outputs.run_url}}
- name: Wait
shell: bash
run: |
timeout="30"
interval="10"
counter=0
timeout_counter=0
while true; do
run_data=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ inputs.token }}" \
"https://api.github.com/repos/${{ inputs.owner }}/${{ inputs.repo }}/actions/runs/${{steps.return_dispatch.outputs.run_id}}")
status=$(echo "$run_data" | jq -r '.status')
echo "Try -> $timeout_counter; status -> $status"
if [ "$status" = "completed" ]; then
conclusion=$(echo "$run_data" | jq -r '.conclusion')
if [ "$conclusion" != "success" ]; then
echo "❌ The workflow has not completed successfully. Exiting."
exit 1
else
echo "✅ The workflow completed successfully! Exiting."
break
fi
fi
# Increment the timeout counter and check if the timeout has been reached
timeout_counter=$((timeout_counter + 1))
if [ $((timeout_counter * interval)) -ge $((timeout * 60)) ]; then
echo "❌ Timeout waiting for the workflow to complete. Exiting."
exit 1
fi
sleep $interval
done
# - name: Wait for workflow to complete
# uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
# with:
# script: |
# var maxRetries = 5
# var retries = 0
# var success = false

# while(retries < maxRetries || !success)
# {
# var workflowRuns = github.rest.actions.getWorkflowRun({
# owner: context.repo.owner,
# repo: context.repo.repo,
# run_id: ${{steps.return_dispatch.outputs.run_id}}
# })

# success = workflowRuns.status == "completed"
# if(!success)
# setTimeout(function(){},5000)
# ++retries
# }


- name: Download all artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,17 @@ jobs:
# file will be used by the upload step
mkdir version-info
echo "$json" > version-info/version_info.json
else
echo "::notice::version-version.json found!"
fi
content=$(cat version-info/version_info.json)
echo "version_name=$(echo $content | jq -r .version_name)" >> $GITHUB_OUTPUT
echo "version_number=$(echo $content | jq -r .version_number)" >> $GITHUB_OUTPUT
- name: Debug
run: |
ls -lAr
exit 1
- name: Upload version info artifact
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
Expand Down

0 comments on commit 6f4f2ae

Please sign in to comment.