GitHub: Added stable sideload deployment to the workflow #4
Workflow file for this run
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
# Copyright (c) 2023 Files Community | |
# Licensed under the MIT License. See the LICENSE. | |
# Abstract: | |
# - This workflow is triggered manually when the maintainer wants publish | |
# a new submission to the Microsoft Store. | |
# - Before submitting to the MS Store, the workflow deploy the package to | |
# the Azure Blob Storage. | |
name: Files Production | |
on: | |
workflow_dispatch: | |
env: | |
SOLUTION_NAME: 'Files.sln' | |
PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' | |
PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' | |
TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' | |
CONFIGURATION: ${{ workflow_dispatch.inputs.branch }} | |
PLATFORM: 'x64' | |
APPX_BUNDLE_PLATFORMS: 'x64|arm64' | |
WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ | |
ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts | |
APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages | |
PACKAGE_DEPLOYMENT_BRANCH: 'Stable' | |
PACKAGE_SUBMISSION_BRANCH: 'Store' | |
run-name: Files Production | |
jobs: | |
# Deploy the package with Stable configured to the Azure Blob Storage | |
deploy: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Deploy to the Azure Blob Storage | |
uses: files-community/Files/.github/workflows/deployment.yml@main | |
with: | |
branch: ${{ env.PACKAGE_DEPLOYMENT_BRANCH }} | |
# Submit the package with Store configured to the Microsoft Store | |
sumbit: | |
runs-on: windows-latest | |
environment: Deployments | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
- name: Setup .NET 7 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Configure the package manifest & logo sets | |
shell: pwsh | |
run: | | |
. './scripts/Configure-AppxManifest.ps1' ` | |
-Branch "$env:PACKAGE_SUBMISSION_BRANCH" ` | |
-PackageProjectDir "$env:PACKAGE_PROJECT_DIR" ` | |
-Publisher "$env:PRODUCTION_PUBLISHER" ` | |
-WorkingDir "$env:WORKING_DIR" | |
env: | |
PRODUCTION_PUBLISHER: 'CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7' | |
- name: Inject the Bing Maps API token | |
shell: pwsh | |
run: | | |
. './scripts/Replace-SpecialString.ps1' ` | |
-WorkingDir "$env:WORKING_DIR" -Target "bingmapskey.secret" -New "$env:BING_MAPS_SECRET" | |
env: | |
BING_MAPS_SECRET: ${{ secrets.BING_MAPS_SECRET }} | |
- name: Inject the AppCenter token | |
shell: pwsh | |
run: | | |
. './scripts/Replace-SpecialString.ps1' ` | |
-WorkingDir "$env:WORKING_DIR" -Target "appcenter.secret" -New "$env:APP_CENTER_SECRET" | |
env: | |
APP_CENTER_SECRET: ${{ secrets.APP_CENTER_SECRET }} | |
- name: Inject the GitHub OAuth client ID | |
run: | | |
. './scripts/Replace-SpecialString.ps1' ` | |
-WorkingDir "$env:WORKING_DIR" -Target "githubclientid.secret" -New "$env:GH_OAUTH_CLIENT_ID" | |
env: | |
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }} | |
- name: Use Windows SDK Preview | |
shell: cmd | |
run: | | |
for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt | |
- name: Restore NuGet | |
shell: pwsh | |
run: 'nuget restore $env:SOLUTION_NAME' | |
- name: Restore Files.sln | |
shell: pwsh | |
run: | | |
msbuild $env:SOLUTION_NAME ` | |
-t:Restore ` | |
-p:Platform=$env:PLATFORM ` | |
-p:Configuration=$env:CONFIGURATION ` | |
-p:PublishReadyToRun=true | |
- name: Build & package Files | |
shell: pwsh | |
run: | | |
msbuild "$env:PACKAGE_PROJECT_PATH" ` | |
-t:Build ` | |
-t:_GenerateAppxPackage ` | |
-p:Platform=$env:PLATFORM ` | |
-p:Configuration=$env:CONFIGURATION ` | |
-p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS ` | |
-p:AppxPackageDir="$env:APPX_PACKAGE_DIR" ` | |
-p:AppxBundle=Always ` | |
-p:UapAppxPackageBuildMode=Sideload ` | |
-p:GenerateAppInstallerFile=True ` | |
-p:AppInstallerUri=https://cdn.files.community/files/preview/ | |
- name: Remove empty files from the packages | |
shell: bash | |
run: find $ARTIFACTS_STAGING_DIR -empty -delete | |
## Create, update and publish submission |