Skip to content

CalculatorNuGet CI (Upgrade) #104

CalculatorNuGet CI (Upgrade)

CalculatorNuGet CI (Upgrade) #104

name: CalculatorNuGet CI (Upgrade)
on:
schedule:
- cron: '0 15 * * 2' # Tuesday 3PM UTC (8AM PST)
push:
branches:
- main
paths:
- '.github/workflows/samples-CalculatorNuGet-ci-upgrade.yml'
jobs:
build:
name: Build
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
sample: [CalculatorNuGet]
architecture: [x86, x64, ARM64]
configuration: [Debug, Release]
reactNativeWindowsVersion: [latest, preview, canary]
steps:
- uses: actions/checkout@v2
- name: Gather environment info
run: npx envinfo
- name: Relocate to reduce long paths
run: Copy-item -Force -Recurse -Verbose "samples\${{ matrix.sample }}" -Destination "..\..\src"
- name: Yarn install
run: yarn install
working-directory: ..\..\src
- name: Upgrade react-native-windows
id: upgrade
continue-on-error: true
run: ${{github.workspace}}\.github\scripts\UpgradeSmokeTest.ps1 ${{ matrix.reactNativeWindowsVersion }} -Force ${{ format('${0}', contains(matrix.reactNativeWindowsVersion, 'canary')) }}
working-directory: ..\..\src
- name: Run react-native-windows-init
if: ${{ steps.upgrade.outcome == 'success' }}
run: npx react-native-windows-init --overwrite --experimentalNuGetDependency true --version ${{ matrix.reactNativeWindowsVersion }}
working-directory: ..\..\src
- name: Decode the pfx
run: |
$PfxBytes = [System.Convert]::FromBase64String("${{ secrets.SAMPLES_BASE64_ENCODED_PFX }}")
$PfxPath = [System.IO.Path]::GetFullPath("${{github.workspace}}\GitHubActionsWorkflow.pfx")
Write-Host $PfxPath
[System.IO.File]::WriteAllBytes("$PfxPath", $PfxBytes)
working-directory: ..\..\src
- name: Run react-native run-windows
if: ${{ steps.upgrade.outcome == 'success' }}
run: npx react-native run-windows --logging --no-packager --no-launch --arch ${{ matrix.architecture }} ${{ startsWith(matrix.architecture, 'ARM') && '--no-deploy' || '' }} ${{ matrix.configuration == 'Release' && '--release' || '' }} --msbuildprops PackageCertificateKeyFile=${{github.workspace}}\GitHubActionsWorkflow.pfx
working-directory: ..\..\src
- name: Remove the pfx
run: |
$certificatePath = [System.IO.Path]::GetFullPath("${{github.workspace}}\GitHubActionsWorkflow.pfx")
Write-Host $certificatePath
Remove-Item -path $certificatePath
working-directory: ..\..\src