Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Fix continuous delivery workflow #41

Merged
merged 3 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,40 @@ jobs:
- name: Build
working-directory: ./src/MSIExtract.AppxPackage
run: |
mkdir .\bin\AppxPackages | Out-Null
$thumbprint = Get-Content .\thumbprint.txt
& MSBuild.exe /nologo /restore /bl /m /p:Configuration=Release /p:Platform=x64 `
/p:BuildAppxUploadPackageForUap=true `
/p:AppxBundle=Always `
/p:AppxPackageSigningEnabled=true `
/p:PackageCertificateThumbprint=$thumbprint `
/p:PackageCertificateThumbprint=492019107FC952A6183CE97F474F9FACB147E7BC `
/p:PackageCertificateKeyFile=.\cert.pfx `
/p:PackageCertificatePassword=1234 `
/t:Publish

- name: Prepare Assets for Upload
working-directory: ./bin/AppxPackages
run: |
cd .\bin\AppxPackages
$uploads = (ls *.appxupload)
mv $uploads[0].FullName MSIXExtractApp_${{ steps.update_version.outputs.version }}.appxupload
$dirs = (ls *_Test)
$bundles = (ls $dirs[0] -Include *.msixbundle)
mv $bundles[0].FullName MSIXExtractApp_${{ steps.update_version.outputs.version }}_Sideload.msixbundle
$uploads = (dir *.msixupload)
if ($uploads.Length -ne 0) {
mv $uploads[0].FullName MSIViewer_${{ steps.update_version.outputs.version }}.msixupload -Verbose
} else {
Write-Error "Could not find any msixupload files"
}

$bundles = (dir *_Test | dir -Include *.msixbundle)
if ($bundles.Length -ne 0) {
mv $bundles[0].FullName MSIViewer_${{ steps.update_version.outputs.version }}_Sideload.msixbundle -Verbose
} else {
Write-Error "Could not find any msixbundle files"
}

- name: Upload Store Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release_notes.outputs.upload_url }}
asset_path: bin/AppxPackages/MSIXExtractApp_${{ steps.update_version.outputs.version }}.appxupload
asset_name: "MSI Viewer ${{ steps.update_version.outputs.version }} Store.appxupload"
asset_path: bin/AppxPackages/MSIViewer_${{ steps.update_version.outputs.version }}.msixupload
asset_name: "MSI Viewer ${{ steps.update_version.outputs.version }} Store.msixupload"
asset_type: application/zip

- name: Upload Sideload Assets
Expand All @@ -91,6 +97,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release_notes.outputs.upload_url }}
asset_path: bin/AppxPackages/MSIXExtractApp_${{ steps.update_version.outputs.version }}_Sideload.msixbundle
asset_path: bin/AppxPackages/MSIViewer_${{ steps.update_version.outputs.version }}_Sideload.msixbundle
asset_name: "MSI Viewer ${{ steps.update_version.outputs.version }} Sideload.msixbundle"
asset_type: application/zip
32 changes: 20 additions & 12 deletions .github/workflows/CD_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
$ref = $ref.Replace("refs/heads/release/", "")
}

$version = [regex]::Replace($ref, '^v(\d+(?:\.\d+){1,2})(-.+)?$', '$1$2')
$version = [regex]::Replace($ref, '^v?(\d+(?:\.\d+){1,2})(-.+)?$', '$1$2')
$json = Get-Content .\version.json | ConvertFrom-Json
$json.version = $version
$json | ConvertTo-Json | Set-Content .\version.json

$version = [regex]::Replace($ref, '^v(\d+(?:\.\d+){1,2})(-.+)?$', '$1')
$version = [regex]::Replace($ref, '^v?(\d+(?:\.\d+){1,2})(-.+)?$', '$1')
if ($version -ne '') {
[xml]$manifest = Get-Content '.\src\MSIExtract.AppxPackage\Package.appxmanifest'
$manifest.Package.Identity.Version = "$($version).0"
Expand All @@ -56,23 +56,31 @@ jobs:
/t:Publish

- name: Prepare Assets for Upload
working-directory: ./bin/AppxPackages
run: |
cd .\bin\AppxPackages
$uploads = (ls *.appxupload)
mv $uploads[0].FullName MSIXExtractApp_${{ steps.update_version.outputs.version }}.appxupload
$dirs = (ls *_Test)
$bundles = (ls $dirs[0] -Include *.msixbundle)
mv $bundles[0].FullName MSIXExtractApp_${{ steps.update_version.outputs.version }}_Sideload.msixbundle
dir -Recurse -Include *.msixupload, *.msixbundle
$uploads = (dir *.msixupload)
if ($uploads.Length -ne 0) {
mv $uploads[0].FullName MSIViewer_${{ steps.update_version.outputs.version }}.msixupload -Verbose
} else {
Write-Error "Could not find any msixupload files"
}

$bundles = (dir *_Test | dir -Include *.msixbundle)
if ($bundles.Length -ne 0) {
mv $bundles[0].FullName MSIViewer_${{ steps.update_version.outputs.version }}_Sideload.msixbundle -Verbose
} else {
Write-Error "Could not find any msixbundle files"
}

- name: Upload Store Assets
uses: actions/upload-artifact@v1
with:
name: "MSI Viewer ${{ steps.update_version.outputs.version }} Store.appxupload"
asset_path: bin/AppxPackages/MSIXExtractApp_${{ steps.update_version.outputs.version }}.appxupload
asset_type: application/zip
name: "MSI Viewer ${{ steps.update_version.outputs.version }} Store.msixupload"
path: bin/AppxPackages/MSIViewer_${{ steps.update_version.outputs.version }}.msixupload

- name: Upload Sideload Assets
uses: actions/upload-artifact@v1
with:
name: "MSI Viewer ${{ steps.update_version.outputs.version }} Sideload.msixbundle"
path: bin/AppxPackages/MSIXExtractApp_${{ steps.update_version.outputs.version }}_Sideload.msixbundle
path: bin/AppxPackages/MSIViewer_${{ steps.update_version.outputs.version }}_Sideload.msixbundle
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.2-dev",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+){1,2}(?:-[a-z0-9.-]+)?$",
"^refs/heads/release/v?\\d+(?:\\.\\d+){1,2}(?:-[a-z0-9.-]+)?$",
"^refs/tags/v\\d+(?:\\.\\d+){1,2}(?:-[a-z0-9.-]+)?$"
]
}