Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5bfa authored Aug 23, 2024
1 parent 9c272af commit 2e83134
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ env:
APP_CREDENTIALS_PATH: '${{ github.workspace }}\src\FluentHub.App\AppCredentials.config'
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages'
AUTOMATED_TESTS_ARCHITECTURE: 'x64'
AUTOMATED_TESTS_CONFIGURATION: 'Release'

jobs:

Expand Down Expand Up @@ -117,7 +119,8 @@ jobs:
-p:Configuration=$env:CONFIGURATION `
-p:PublishReadyToRun=true
- name: Build FluentHub
- if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION || env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE
name: Build FluentHub
run: |
msbuild `
$env:PACKAGE_PROJECT_PATH `
Expand All @@ -127,8 +130,48 @@ jobs:
-p:Platform=$env:ARCHITECTURE `
-p:AppxBundle=Never
- if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE
name: Build & package Files
run: |
msbuild `
$env:PACKAGE_PROJECT_PATH `
-t:Build `
-t:_GenerateAppxPackage `
-clp:ErrorsOnly `
-p:Configuration=$env:CONFIGURATION `
-p:Platform=$env:ARCHITECTURE `
-p:AppxBundlePlatforms=$env:AUTOMATED_TESTS_ARCHITECTURE `
-p:AppxBundle=Always `
-p:UapAppxPackageBuildMode=SideloadOnly `
-p:AppxPackageDir=$env:APPX_PACKAGE_DIR `
-p:AppxPackageSigningEnabled=true `
-p:PackageCertificateKeyFile=$env:APPX_SELFSIGNED_CERT_PATH `
-p:PackageCertificatePassword="" `
-p:PackageCertificateThumbprint=""
- name: Upload the packages to the Artifacts
uses: actions/upload-artifact@v4
with:
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})'
path: ${{ env.ARTIFACTS_STAGING_DIR }}
path: ${{ env.ARTIFACTS_STAGING_DIR }}

- if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION
name: Get artifact size
uses: actions/github-script@v6
with:
script: |
const { data: artifacts } = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
});
const artifact = artifacts.artifacts.find(a => a.name === 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})');
if (artifact) {
console.log(`Artifact Size: ${artifact.size_in_bytes} bytes`);
core.setOutput("artifact-size", artifact.size_in_bytes);
} else {
console.log('Artifact not found.');
}
echo "Artifact size is ${{ steps.get_artifact_size.outputs.artifact-size }} bytes."

0 comments on commit 2e83134

Please sign in to comment.