This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1057 from microsoft/pre-release
release 1.6.5
- Loading branch information
Showing
81 changed files
with
1,779 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Close resolved issues | ||
|
||
on: | ||
schedule: | ||
- cron: "0 * * * *" | ||
|
||
jobs: | ||
stale: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: blackchoey/stale@releases/v1.2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue has been resolved and it will be closed if no further activity occurs within 3 days. Thank you for your contributions.' | ||
stale-issue-label: 'pending close' | ||
days-before-stale: 7 | ||
only-labels: 'resolved' | ||
last-updated-user-type: 'collaborator' | ||
days-before-close: 3 | ||
operations-per-run: 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Pickup issues that needs attention | ||
|
||
on: | ||
schedule: | ||
- cron: "0 * * * *" | ||
|
||
jobs: | ||
stale: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: blackchoey/stale@releases/v1.2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue has no recent activities, please take a look and provide updates for it.' | ||
stale-issue-label: 'need attention' | ||
days-before-stale: 3 | ||
last-updated-user-type: 'non-collaborator' | ||
days-before-close: 999 | ||
operations-per-run: 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Mark stale issues and close them | ||
|
||
on: | ||
schedule: | ||
- cron: "0 * * * *" | ||
|
||
jobs: | ||
stale: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: blackchoey/stale@releases/v1.2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue has been automatically marked as stale because it has no recent activities. It will be closed if no further activity occurs within 3 days. Thank you for your contributions.' | ||
stale-issue-label: 'stale' | ||
days-before-stale: 7 | ||
only-labels: 'need more info' | ||
last-updated-user-type: 'collaborator' | ||
days-before-close: 3 | ||
operations-per-run: 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
param( | ||
[string] | ||
$Environment = "staging", | ||
$ArduinoConfigFileName = "package_pnp_mxchip_board_preview_index.json" | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
$CurrentDir = (Get-Location).Path | ||
|
||
Import-Module "C:\Program Files (x86)\WindowsPowerShell\Modules\AzureRM.Profile\4.6.0\AzureRM.Profile.psd1" | ||
Import-Module "C:\Program Files (x86)\WindowsPowerShell\Modules\Azure.Storage\4.2.1\Azure.Storage.psd1" | ||
Import-Module "C:\Program Files (x86)\WindowsPowerShell\Modules\Azure\5.1.2\Azure.psd1" | ||
|
||
|
||
$StorageHashTable = @{"azureboard2" = $env:Azureboard2StorageKey; | ||
"azureboard" = $env:AzureboardStorageKey}; | ||
|
||
foreach($StorageAccountName in $StorageHashTable.Keys) | ||
{ | ||
Write-Host("[$Environment][$StorageAccountName]: Start $Environment Deployment."); | ||
|
||
################################################################################ | ||
# Step 1: upload AZ3166 package to Azure blob storage # | ||
################################################################################ | ||
|
||
Write-Host("Step 1: upload AZ3166 package to Azure blob storage"); | ||
$ArduinoPackageContainer = "arduinopackage" | ||
$PackageInfoContainer = "packageinfo" | ||
|
||
# We can move this credential to Azure Key Vault once we have deploy with production subscription | ||
$Key = $StorageHashTable[$StorageAccountName]; | ||
$StorageContext = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $Key | ||
|
||
# Get current package version | ||
$CurrentVersion = Get-Content '.\system_version.txt' | Out-String | ||
$CurrentVersion = $CurrentVersion.ToString().Trim() + "-preview" | ||
|
||
# Upload Arduino package | ||
$ArduinoPackageFilePath = Join-Path -Path (Get-Location).Path -ChildPath "\TestResult\AZ3166-$CurrentVersion.zip" | ||
$ArduinoPackageBlobName = "AZ3166-" + $CurrentVersion + ".zip" | ||
Set-AzureStorageBlobContent -Context $StorageContext -Container $Environment -File $ArduinoPackageFilePath -Blob "$ArduinoPackageContainer\$ArduinoPackageBlobName" -Force | ||
|
||
# Upload Firmware bin file | ||
$FirmwareFileName = "devkit-firmware-" + $CurrentVersion + "." + $env:BUILD_NUMBER + "bin" | ||
$FirmwareFilePath = Join-Path -Path (Get-Location).Path -ChildPath "TestResult\$FirmwareFileName" | ||
Set-AzureStorageBlobContent -Context $StorageContext -Container $Environment -File $FirmwareFilePath -Blob $FirmwareFileName -Force | ||
|
||
#Upload Getstarted bin file | ||
#$GetstartedFileName = "devkit-getstarted-" + $CurrentVersion + "." + $env:BUILD_NUMBER + "bin" | ||
#$GetstartedFilePath = Join-Path -Path (Get-Location).Path -ChildPath "TestResult\$GetstartedFileName" | ||
#Set-AzureStorageBlobContent -Context $StorageContext -Container $Environment -File $GetstartedFilePath -Blob $GetstartedFileName -Force | ||
|
||
#Upload iotc bin file iotc-devkit-1.9.10.bin | ||
$IoTCFileName = "iotc-devkit-" + $CurrentVersion + "." + $env:BUILD_NUMBER + "bin" | ||
$IoTCFilePath = Join-Path -Path (Get-Location).Path -ChildPath "TestResult\$IoTCFileName" | ||
Set-AzureStorageBlobContent -Context $StorageContext -Container $Environment -File $IoTCFilePath -Blob $IoTCFileName -Force | ||
|
||
# Upload Firmware bin file for OTA | ||
$OTAFirmwareFileName = "devkit-firmware-latest.ota-preview.bin" | ||
$OTAFirmwareFilePath = Join-Path -Path (Get-Location).Path -ChildPath "TestResult\$OTAFirmwareFileName" | ||
Set-AzureStorageBlobContent -Context $StorageContext -Container $Environment -File $OTAFirmwareFilePath -Blob $OTAFirmwareFileName -Force | ||
|
||
################################################################################ | ||
# Step 2: Calculate package MD5 checksum and Update to configuration JSON file# | ||
################################################################################ | ||
|
||
Write-Host("Step 2: Calculate package MD5 checksum and Update to configuration JSON file") | ||
|
||
$MD5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider | ||
$ArduinoPackageHash = [System.BitConverter]::ToString($MD5.ComputeHash([System.IO.File]::ReadAllBytes($ArduinoPackageFilePath))) | ||
$ArduinoPackageHash = $ArduinoPackageHash.ToLower() -replace '-', '' | ||
Write-Host($ArduinoPackageHash); | ||
|
||
Get-AzureStorageBlobContent -Context $StorageContext -Container $Environment -Blob "$PackageInfoContainer\$ArduinoConfigFileName" -Destination $ArduinoConfigFileName -Force | ||
$ArduinoConfigJson = Get-Content $ArduinoConfigFileName | Out-String | ConvertFrom-Json | ||
|
||
$totalVersions = $ArduinoConfigJson.packages[0].platforms.Count | ||
$LastPlatform = ([PSCustomObject]($ArduinoConfigJson.packages[0].platforms[$totalVersions - 1])) | ||
|
||
if ($LastPlatform.version -eq $CurrentVersion) | ||
{ | ||
echo LastPlatformversion ----> $LastPlatform.version | ||
echo CurrentVersion -----> $CurrentVersion | ||
|
||
|
||
# Update the latest version | ||
$LastPlatform.url = "https://azureboard2.azureedge.net/$Environment/$ArduinoPackageContainer/$ArduinoPackageBlobName" | ||
$LastPlatform.archiveFileName = $ArduinoPackageBlobName | ||
$LastPlatform.checksum = "MD5:" + $ArduinoPackageHash | ||
$LastPlatform.size = (Get-Item $ArduinoPackageFilePath).Length.ToString() | ||
} | ||
else | ||
{ | ||
# Add new version | ||
$NewPlatform = New-Object PSCustomObject | ||
|
||
$LastPlatform.psobject.properties | % { | ||
$newPlatform | Add-Member -MemberType $_.MemberType -Name $_.Name -Value $_.Value | ||
} | ||
|
||
$NewPlatform.version = $CurrentVersion | ||
$NewPlatform.url = "https://azureboard2.azureedge.net/$Environment/$ArduinoPackageContainer/$ArduinoPackageBlobName" | ||
$NewPlatform.archiveFileName = $ArduinoPackageBlobName | ||
$NewPlatform.checksum = "MD5:" + $ArduinoPackageHash | ||
$NewPlatform.size = (Get-Item $ArduinoPackageFilePath).Length.ToString() | ||
|
||
$ArduinoConfigJson.packages[0].platforms += $newPlatform | ||
$totalVersions += 1 | ||
} | ||
|
||
Write-Host("Total packages versions: $totalVersions") | ||
|
||
# We only maintain the latest 5 versions | ||
if ($totalVersions -gt 5) | ||
{ | ||
# Remove the oldest one | ||
$ArduinoConfigJson.packages[0].platforms = $ArduinoConfigJson.packages[0].platforms[1..($totalVersions - 1)] | ||
} | ||
|
||
$ArduinoConfigJson | ConvertTo-Json -Depth 10 | Out-File $ArduinoConfigFileName -Encoding ascii | ||
|
||
# Upload Arduino configuration file to Azure blob storage | ||
$ArduinoConfigJsonBlobName = "$PackageInfoContainer/$ArduinoConfigFileName" | ||
Set-AzureStorageBlobContent -Context $StorageContext -Container $Environment -File $ArduinoConfigFileName -Blob $ArduinoConfigJsonBlobName -Force | ||
|
||
$ArduinoConfigJsonBlobURL = "https://azureboard2.azureedge.net/$Environment/$ArduinoConfigJsonBlobName" | ||
Write-Host("Arduino board manager JSON file URI: $ArduinoConfigJsonBlobURL") | ||
|
||
Write-Host("[$Environment][$StorageAccountName]: Deployment completed."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.