This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·58 lines (50 loc) · 2.39 KB
/
ci.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
name: TON Smart Challenge 5
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Filter and Archive code
run: |
mkdir -p contracts_filtered
find contracts -type f \( -name '*.fc' \) -exec cp {} contracts_filtered/ \;
cd contracts_filtered
zip -r ../code.zip .
- name: Send archive to endpoint and wait for response
env:
ENDPOINT_URL: "https://submissions.tonsmartchallenge.org/tsc5"
run: |
response=$(curl -s -w "%{http_code}" --max-time 600 -X POST -H "Content-Type: multipart/form-data" -F "[email protected]" -F "token=${{secrets.USER_TOKEN}}" -F "github=${{github.repository_owner}}" $ENDPOINT_URL -o response.json)
status_code=$response
if [ $status_code -eq 200 ]; then
echo "Package delivered successfully."
echo "::set-output name=success::true" # Set success to true
else
echo "Failed to submit TON Tact Challenge solution. Status code: $status_code"
error_message=$(cat response.json | jq -r '.error')
echo "Error message: $error_message"
echo "::set-output name=success::false" # Set success to false
exit 1 # Exit with a non-zero code to mark the action as failed
fi
sleep 10 # Adjust the wait time as needed
- name: Set action status
id: status
run: |
minChallengePassed=$(cat response.json | jq -r '.minChallangePassed')
report=$(cat response.json | jq -r '.md')
echo "$report" > $GITHUB_STEP_SUMMARY
if [ "$minChallengePassed" == "true" ]; then
echo "success=true" >> $GITHUB_ENV # Set success to true using Environment Files
echo "Detailed summary report: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
else
echo "success=false" >> $GITHUB_ENV # Set success to false using Environment Files
echo "Submission failed" # Display an error message for failed deployment
echo "Detailed summary report: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
exit 1 # Exit with a non-zero code to mark the action as failed
fi