Release Builder #16
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
name: Release Builder | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: '版本号' | |
required: true | |
default: '0.0.0.0' | |
jobs: | |
release: | |
runs-on: windows-latest | |
name: Build Release ${{github.event.inputs.version}} | |
env: | |
SigningCertificate: App_TemporaryKey.pfx | |
PackageCertificatePassword: ${{ secrets.PackageCertificatePassword }} | |
Solution_Path: .\FluentWeather.sln | |
UWP_Project_Directory: .\FluentWeather.Uwp | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Configure Pagefile | |
uses: al-cheb/[email protected] | |
with: | |
minimum-size: 32GB | |
maximum-size: 32GB | |
disk-root: "C:" | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{github.event.inputs.version}} | |
release_name: ${{github.event.inputs.version}} | |
draft: true | |
prerelease: false | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Update manifest version | |
run: | | |
[xml]$manifest = get-content ".\$env:UWP_Project_Directory\Package.appxmanifest" | |
$manifest.Package.Identity.Version = "${{github.event.inputs.version}}" | |
$manifest.save(".\$env:UWP_Project_Directory\Package.appxmanifest") | |
- name: Build x86 | |
run: msbuild $env:Solution_Path /p:Platform=x86 /p:AppxBundlePlatforms="x86" /p:AppxPackageDir=C:\Package\x86 /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:PackageCertificatePassword /restore | |
env: | |
BuildMode: SideloadOnly | |
Configuration: Release | |
- name: Build x64 | |
run: msbuild $env:Solution_Path /p:Platform=x64 /p:AppxBundlePlatforms="x64" /p:AppxPackageDir=C:\Package\x64 /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:PackageCertificatePassword /restore | |
env: | |
BuildMode: SideloadOnly | |
Configuration: Release | |
- name: Build ARM64 | |
run: msbuild $env:Solution_Path /p:Platform=ARM64 /p:AppxBundlePlatforms="ARM64" /p:AppxPackageDir=C:\Package\ARM64 /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:PackageCertificatePassword /restore | |
env: | |
BuildMode: SideloadOnly | |
Configuration: Release | |
- name: Update x86 release asset | |
id: upload-release-asset-x86 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: C:\Package\x86\FluentWeather.Uwp_${{github.event.inputs.version}}_x86_Test\FluentWeather.Uwp_${{github.event.inputs.version}}_x86.msix | |
asset_name: FluentWeather.Uwp_${{github.event.inputs.version}}_x86.msix | |
asset_content_type: application/octet-stream | |
- name: Update x64 release asset | |
id: upload-release-asset-x64 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: C:\Package\x64\FluentWeather.Uwp_${{github.event.inputs.version}}_x64_Test\FluentWeather.Uwp_${{github.event.inputs.version}}_x64.msix | |
asset_name: FluentWeather.Uwp_${{github.event.inputs.version}}_x64.msix | |
asset_content_type: application/octet-stream | |
- name: Update ARM64 release asset | |
id: upload-release-asset-ARM64 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: C:\Package\ARM64\FluentWeather.Uwp_${{github.event.inputs.version}}_ARM64_Test\FluentWeather.Uwp_${{github.event.inputs.version}}_ARM64.msix | |
asset_name: FluentWeather.Uwp_${{github.event.inputs.version}}_ARM64.msix | |
asset_content_type: application/octet-stream | |
- name: Update certificate | |
id: upload-release-asset-cert | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: C:\Package\x64\FluentWeather.Uwp_${{github.event.inputs.version}}_x64_Test\FluentWeather.Uwp_${{github.event.inputs.version}}_x64.cer | |
asset_name: FluentWeather.Uwp_${{github.event.inputs.version}}.cer | |
asset_content_type: application/octet-stream |