Skip to content
Permalink
master
Switch branches/tags
View runs Go to file
 
 
Cannot retrieve contributors at this time
name: Release builder
on:
push:
tags: 'v*'
jobs:
release:
runs-on: windows-latest
env:
SigningCertificate: MyGitHubApp_TemporaryKey.pfx
Solution_Path: MyGitHubApp.sln
UWP_Project_Path: MyGitHubApp.csproj
UWP_Project_Directory: .\
steps:
- name: Configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 32GB
maximum-size: 32GB
disk-root: "C:"
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Use tag
run: echo ${{steps.tag.outputs.tag}}
- name: Extract version from tag
uses: Amadevus/pwsh-script@v1
id: getVersion
with:
script: '("${{steps.tag.outputs.tag}}").Split("v")[1]'
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.0
- name: Update manifest version
run: |
[xml]$manifest = get-content ".\$env:UWP_Project_Directory\Package.appxmanifest"
$manifest.Package.Identity.Version = "${{steps.getVersion.outputs.result}}"
$manifest.save(".\$env:UWP_Project_Directory\Package.appxmanifest")
- name: Decode the Pfx
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
$currentDirectory = Get-Location
$certificatePath = Join-Path -Path $currentDirectory -ChildPath $env:UWP_Project_Directory -AdditionalChildPath $env:SigningCertificate
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
- name: Build the sideload solution
run: msbuild $env:Solution_Path /p:Platform=x86 /p:AppxBundle=$env:AppxBundle /p:AppxBundlePlatforms="x86|x64" /p:AppxPackageDir=C:\DeployOutput /p:PackageCertificateKeyFile=$env:SigningCertificate /restore
env:
AppxBundle: Always
BuildMode: StoreUpload
Configuration: Release
- name: Remove the .pfx
run: Remove-Item -path $env:UWP_Project_Directory/$env:SigningCertificate
- name: Create archive
run: Compress-Archive -Path C:\DeployOutput\* -DestinationPath C:\DeployOutput\StorePackage_${{steps.getVersion.outputs.result}}.zip
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: RC ${{steps.getVersion.outputs.result}}
draft: false
prerelease: false
- name: Update release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: C:\DeployOutput\StorePackage_${{steps.getVersion.outputs.result}}.zip
asset_name: StorePackage_${{steps.getVersion.outputs.result}}.zip
asset_content_type: application/zip