Skip to content

Commit

Permalink
Merge pull request #36 from aleks-ivanov/feature/owner-feedback
Browse files Browse the repository at this point in the history
Add AppCenterSecret assignment in build process from GitHub Secrets AB#325
  • Loading branch information
kulov authored Mar 2, 2021
2 parents dd2b3a1 + cf86468 commit e9eca7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ jobs:
/p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS `
/p:AppxPackageDir=$env:ARTIFACTS_DIR `
/p:PackageCertificateKeyFile=$env:PACKAGE_CERTIFICATE_KEYFILE `
/p:PackageCertificatePassword=$env:PACKAGE_CERTIFICATE_PASSWORD
/p:PackageCertificatePassword=$env:PACKAGE_CERTIFICATE_PASSWORD `
/p:AppCenterSecret=$env:APP_CENTER_SECRET
env:
PLATFORM: x64
UAP_APPX_PACKAGE_BUILD_MODE: StoreUpload
Expand All @@ -184,6 +185,7 @@ jobs:
ARTIFACTS_DIR: ${{ github.workspace }}\Artifacts
PACKAGE_CERTIFICATE_KEYFILE: ${{ github.workspace }}\cert.pfx
PACKAGE_CERTIFICATE_PASSWORD: ${{ secrets.PACKAGE_CERTIFICATE_PWD }}
APP_CENTER_SECRET: ${{ secrets.APP_CENTER_SECRET }}

- if: steps.step_conditionals_handler.outputs.is_not_pr == 'true'
name: Send SonarCloud results
Expand Down
10 changes: 10 additions & 0 deletions src/Notepads/Notepads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,16 @@
<AppxManifest Include="$(GeneratedAppxManifest)" />
</ItemGroup>
</Target>
<Target Name="AssignAppCenterSecret" BeforeTargets="BeforeBuild" Condition=" $(AppCenterSecret) != '' ">
<PropertyGroup>
<InputFile>App.xaml.cs</InputFile>
</PropertyGroup>
<WriteLinesToFile
File="$(InputFile)"
Lines="$([System.IO.File]::ReadAllText($(InputFile)).Replace('AppCenterSecret = null','AppCenterSecret = &quot;$(AppCenterSecret)&quot;'))"
Overwrite="true"
Encoding="Unicode"/>
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down

0 comments on commit e9eca7c

Please sign in to comment.