CI: Enable UWP/AppX releases

This commit is contained in:
Connor McLaughlin 2021-07-11 16:47:10 +10:00
parent a2c2dd31a2
commit c3cbe3b969

View file

@ -144,6 +144,83 @@ jobs:
path: "duckstation-windows-arm64-release.zip"
windows-uwp-build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2.3.1
with:
fetch-depth: 0
submodules: false
- name: Tag as preview build
if: github.ref == 'refs/heads/master'
shell: cmd
run: |
echo #pragma once > src/scmversion/tag.h
echo #define SCM_RELEASE_ASSET "duckstation-windows-x64-release.zip" >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h
- name: Tag as dev build
if: github.ref == 'refs/heads/dev'
shell: cmd
run: |
echo #pragma once > src/scmversion/tag.h
echo #define SCM_RELEASE_ASSET "duckstation-windows-x64-release.zip" >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h
- name: Write signing key
id: write_signing_key
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
uses: timheuer/base64-to-file@v1
with:
fileName: 'duckstation-uwp.pfx'
encodedString: ${{ secrets.UWP_PFX_KEY }}
- name: Copy signing key
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
shell: cmd
run: |
copy ${{ steps.write_signing_key.outputs.filePath }} src\duckstation-uwp\duckstation-uwp.pfx
- name: Restore nuget packages
shell: cmd
run: |
nuget restore duckstation-uwp.sln
- name: Compile x64 release build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
msbuild duckstation-uwp.sln /p:AppxBundle=Always /p:AppxPackageIsForStore=true /p:BuildAppxUploadPackageForUap=true /p:AppxBundlePlatforms="x64" /p:Configuration="ReleaseUWP" /p:Platform="x64" /t:Build
- name: Grab AppX package
shell: cmd
run: |
copy build\ReleaseUWP-x64\duckstation-uwp\duckstation-uwp_1.0.0.0_Bundle\duckstation-uwp_1.0.0.0_x64_ReleaseUWP.appx duckstation-uwp.appx
- name: Export certificate
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
shell: powershell
run: |
Get-PfxCertificate -FilePath .\src\duckstation-uwp\duckstation-uwp.pfx | Export-Certificate -FilePath duckstation-uwp.der -Type CERT
- name: Upload AppX package
uses: actions/upload-artifact@v1
with:
name: "windows-uwp"
path: "duckstation-uwp.appx"
- name: Upload certificate
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
uses: actions/upload-artifact@v1
with:
name: "windows-uwp"
path: "duckstation-uwp.der"
linux-build:
runs-on: ubuntu-20.04
steps:
@ -227,7 +304,7 @@ jobs:
create-release:
needs: [windows-build, windows-arm64-build, linux-build]
needs: [windows-build, windows-arm64-build, linux-build, windows-uwp-build]
runs-on: "ubuntu-20.04"
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
steps:
@ -241,6 +318,11 @@ jobs:
with:
name: "windows-arm64"
- name: Download Windows UWP Artifact
uses: actions/download-artifact@v1
with:
name: "windows-uwp"
- name: Download NoGUI AppImage Artifact
uses: actions/download-artifact@v1
with:
@ -274,6 +356,8 @@ jobs:
windows/duckstation-windows-x64-release-symbols.zip
windows-arm64/duckstation-windows-arm64-release.zip
windows-arm64/duckstation-windows-arm64-release-symbols.zip
windows-uwp/duckstation-uwp.appx
windows-uwp/duckstation-uwp.der
linux-x64-appimage-nogui/duckstation-nogui-x64.AppImage
linux-x64-appimage-nogui-zsync/duckstation-nogui-x64.AppImage.zsync
linux-x64-appimage-qt/duckstation-qt-x64.AppImage
@ -292,6 +376,8 @@ jobs:
windows/duckstation-windows-x64-release-symbols.zip
windows-arm64/duckstation-windows-arm64-release.zip
windows-arm64/duckstation-windows-arm64-release-symbols.zip
windows-uwp/duckstation-uwp.appx
windows-uwp/duckstation-uwp.der
linux-x64-appimage-nogui/duckstation-nogui-x64.AppImage
linux-x64-appimage-nogui-zsync/duckstation-nogui-x64.AppImage.zsync
linux-x64-appimage-qt/duckstation-qt-x64.AppImage