-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Copyright (c) 2024 0x5BFA | ||
# Licensed under the MIT License. See the LICENSE. | ||
|
||
name: FluentHub CD (Store) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
WORKING_DIR: '${{ github.workspace }}' # Default: 'D:\a\FluentHub\FluentHub' | ||
SOLUTION_PATH: '${{ github.workspace }}\FluentHub.sln' | ||
PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\FluentHub.Package' | ||
PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\FluentHub.Package\FluentHub.Package.wapproj' | ||
AUTOMATED_TESTS_ARCHITECTURE: 'x64' | ||
AUTOMATED_TESTS_CONFIGURATION: 'Release' | ||
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' | ||
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' | ||
APP_CREDENTIALS_PATH: '${{ github.workspace }}\src\FluentHub.App\AppCredentials.config' | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
if: github.repository_owner == '0x5bfa' | ||
|
||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: [Store] | ||
platform: [x64] | ||
env: | ||
CONFIGURATION: ${{ matrix.configuration }} | ||
ARCHITECTURE: ${{ matrix.platform }} | ||
|
||
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 8 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Save base64 credentials into a file | ||
shell: pwsh | ||
run: | | ||
$bytes = [Convert]::FromBase64String($env:GH_CREDENTIALS_SECRET) | ||
[IO.File]::WriteAllBytes($env:APP_CREDENTIALS_PATH, $bytes) | ||
env: | ||
GH_CREDENTIALS_SECRET: '${{ secrets.GH_CREDENTIALS_JSON_BASE64 }}' | ||
|
||
- name: Restore NuGet | ||
shell: pwsh | ||
run: 'nuget restore $env:SOLUTION_PATH' | ||
|
||
- name: Restore FluentHub | ||
shell: pwsh | ||
run: | | ||
msbuild $env:SOLUTION_PATH ` | ||
-t:Restore ` | ||
-p:Platform=$env:ARCHITECTURE ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:PublishReadyToRun=true | ||
- name: Build FluentHub | ||
run: | | ||
msbuild ` | ||
$env:PACKAGE_PROJECT_PATH ` | ||
-t:Build ` | ||
-clp:ErrorsOnly ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:Platform=$env:ARCHITECTURE ` | ||
-p:AppxBundle=Never | ||
- name: Upload the packages to the Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})' | ||
path: ${{ env.ARTIFACTS_STAGING_DIR }} |