Skip to content

Commit 5f65a88

Browse files
committed
update build script
1 parent 81cf8e5 commit 5f65a88

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

Denna/appcenter-post-build.ps1

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
$megtxt="Denna insider build $env:APPCENTER_BUILD_ID on $env:APPCENTER_BRANCH is now available at:
22
https://install.appcenter.ms/orgs/mahstudio-u5ev/apps/denna/distribution_groups/Insiders
33
4+
and full package including dependencies and certificate is here:
5+
https://github.com/MahStudio/Denna/releases/latest
6+
47
Any issues? Post is here:
58
https://github.com/MahStudio/Denna/issues
69
@@ -12,23 +15,19 @@ Invoke-WebRequest -Uri "https://api.telegram.org/bot$env:BotSecret/sendMessage?c
1215
Invoke-WebRequest -Uri "https://api.telegram.org/bot$env:BotSecret/sendMessage?chat_id=$env:ChannelId&text=$megtxt"
1316

1417

15-
Compress-Archive -path "$env:APPCENTER_SOURCE_DIRECTORY\Denna\Denna\AppPackages" -DestinationPath "$env:APPCENTER_SOURCE_DIRECTORY\Denna\Denna\Build.zip"
16-
17-
18-
19-
$versionNumber = $env:APPCENTER_BUILD_ID
18+
$versionNumber = 12
2019
$preRelease = $TRUE
2120
$releaseNotes=$megtxt
22-
$artifactOutputDirectory="$env:APPCENTER_SOURCE_DIRECTORY\Denna\Denna"
23-
$artifact="Build.zip"
21+
$artifactOutputDirectory="$env:APPCENTER_SOURCE_DIRECTORY\Denna\Denna\AppPackages"
22+
2423
$gitHubUsername="MahStudio"
2524
$gitHubRepository="Denna"
2625
$gitHubApiKey="$env:GithubSicktear"
2726
$draft = $FALSE
2827

2928
$releaseData = @{
30-
tag_name = [string]::Format("v{0}", $versionNumber);
31-
name = [string]::Format("v{0}", $versionNumber);
29+
tag_name = [string]::Format("Build{0}", $versionNumber);
30+
name = [string]::Format("Build{0}", $versionNumber);
3231
body = $releaseNotes;
3332
draft = $draft;
3433
prerelease = $preRelease;
@@ -47,11 +46,16 @@ $gitHubApiKey="$env:GithubSicktear"
4746
}
4847

4948
$result = Invoke-RestMethod @releaseParams
49+
$include = @("*.appxbundle","*.cer","*.appx")
50+
$removefiles = Get-ChildItem "$artifactOutputDirectory" -recurse -force -include $include | % { $_.FullName }
51+
52+
foreach ($file in $removefiles) {
5053
$uploadUri = $result | Select -ExpandProperty upload_url
5154
Write-Host $uploadUri
5255
$uploadUri = $uploadUri -creplace '\{\?name,label\}' #, "?name=$artifact"
53-
$uploadUri = $uploadUri + "?name=$artifact"
54-
$uploadFile = Join-Path -path $artifactOutputDirectory -childpath $artifact
56+
$outputFile = Split-Path $file -leaf
57+
$parent = (get-item $file ).parent
58+
$uploadUri = $uploadUri + "?name=$parent$outputFile"
5559

5660
$uploadParams = @{
5761
Uri = $uploadUri;
@@ -60,6 +64,7 @@ $gitHubApiKey="$env:GithubSicktear"
6064
Authorization = $auth;
6165
}
6266
ContentType = 'application/zip';
63-
InFile = $uploadFile
67+
InFile = $file
6468
}
6569
$result = Invoke-RestMethod @uploadParams
70+
}

0 commit comments

Comments
 (0)