-
Notifications
You must be signed in to change notification settings - Fork 26
62 lines (53 loc) · 1.97 KB
/
template-buildexample.yml
File metadata and controls
62 lines (53 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build Example
on:
workflow_call:
inputs:
vmImage:
required: false
default: 'windows-latest'
type: string
exampleName:
required: false
default: 'example'
type: string
useBuildCertificate:
required: false
default: false
type: boolean
jobs:
build-example:
name: Build ${{ inputs.exampleName }}
runs-on: ${{ inputs.vmImage }}
steps:
- uses: actions/checkout@v4
- name: yarn install
run: yarn install
- name: build TS
run: yarn build
- name: Decode the pfx
if: ${{ inputs.useBuildCertificate }}
run: |
$PfxBytes = [System.Convert]::FromBase64String("${{ secrets.EXAMPES_BASE64_ENCODED_PFX }}")
$PfxPath = [System.IO.Path]::GetFullPath("${{github.workspace}}\GitHubActionsWorkflow.pfx")
Write-Host $PfxPath
[System.IO.File]::WriteAllBytes("$PfxPath", $PfxBytes)
working-directory: ${{ inputs.exampleName }}
- name: yarn windows
run: npx @react-native-community/cli run-windows --no-launch --no-deploy --no-packager --logging ${{ inputs.useBuildCertificate && '--msbuildprops PackageCertificateKeyFile=${{github.workspace}}\GitHubActionsWorkflow.pfx' || '' }}
working-directory: ${{ inputs.exampleName }}
- name: Remove the pfx
if: ${{ inputs.useBuildCertificate }}
run: |
$certificatePath = [System.IO.Path]::GetFullPath("${{github.workspace}}\GitHubActionsWorkflow.pfx")
Write-Host $certificatePath
Remove-Item -path $certificatePath
working-directory: ${{ inputs.exampleName }}
- name: test app
run: yarn test
working-directory: ${{ inputs.exampleName }}
- name: Upload appx
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.exampleName }} appx
path: ${{ inputs.exampleName }}\windows\AppPackages\${{ inputs.exampleName }}\${{ inputs.exampleName }}_1.0.0.0_x64_Debug_Test
if-no-files-found: error