9292 .\Scripts\BuildRelease.ps1 -version $env:Version
9393 shell : pwsh
9494
95- - name : Submit virustotal scan
96- shell : pwsh
97- run : |
98- cd Publish
99- $apiKey = "${{ secrets.VIRUSTOTAL_APIKEY }}"
100- $archiveName = "daybreakv${{ env.Version }}.zip"
101- $uploadUrlResponse = curl https://www.virustotal.com/api/v3/files/upload_url -H x-apikey:"$apiKey"
102- $uploadUrlResponse
103- $uploadUrlJson = $uploadUrlResponse | ConvertFrom-Json
104- $uploadUrl = $uploadUrlJson.data
105- $uploadResponse = curl --request POST --header x-apikey:"$apiKey" --header 'content-type: multipart/form-data' --form file="@$archiveName" --url $uploadUrl
106- $uploadResponse
107- $uploadResponseJson = $uploadResponse | ConvertFrom-Json
108- $resultsUrl = "https://www.virustotal.com/api/v3/analyses/$($uploadResponseJson.data.id)"
109- $resultsUrl
110- # Poll the results until the status is "completed"
111- $status = ""
112- while ($status -ne "completed") {
113- Start-Sleep -Seconds 10 # Wait for 10 seconds between checks
114- $results = curl --header x-apikey:"$apiKey" --url $resultsUrl
115- $results
116- $resultsJson = $results | ConvertFrom-Json
117- $status = $resultsJson.data.attributes.status
118- Write-Host "Current status: $status"
119- }
120-
121- $resultsJson.data.attributes.results | ConvertTo-Json | Out-File -FilePath "VirusTotal.Results.json" -Encoding UTF8
122- $resultsJson.data.attributes.stats | ConvertTo-Json | Out-File -FilePath "VirusTotal.Stats.json" -Encoding UTF8
123- $stats = $resultsJson.data.attributes.stats
124- echo "::set-env name=VirusTotalStats::$stats"
125-
12695 - name : Publish blob files
12796 run : |
12897 Write-Host $env
@@ -135,16 +104,11 @@ jobs:
135104 mode : update
136105 tag_name : v${{ env.Version }}
137106 release_name : Daybreak v${{ env.Version }}
138- assets : .\Publish\daybreakv${{ env.Version }}.zip;.\Publish\VirusTotal.Results.json;.\Publish\VirusTotal.Stats.json
107+ assets : .\Publish\daybreakv${{ env.Version }}.zip
139108 github_token : ${{ env.GITHUB_TOKEN }}
140109 replace_assets : true
141110 body_mrkdwn : |
142111 ${{ env.Changelog }}
143-
144- ** VirustTotal Stats: **
145- ```
146- ${{ env.VirusTotalStats }}
147- ```
148112 isDraft : true
149113 env :
150114 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments