1+ name : ' openHAB Build CI Build'
2+ run-name : app-ci-${{github.run_id }}
3+
4+ env :
5+ BuildDirectory : ' ${{github.workspace}}\build'
6+
7+ on :
8+ pull_request :
9+ branches :
10+ - main
11+
12+ jobs :
13+ configure :
14+ name : Configure Build
15+ runs-on : ubuntu-latest
16+ outputs :
17+ buildConfiguration : ${{ steps.configuration.outputs.BuildConfiguration }}
18+ bundlePlatforms : ${{ steps.configuration.outputs.BundlePlatforms }}
19+ buildNumber : ${{ steps.buildnumber.outputs.BUILD_NUMBER }}
20+ releaseName : ${{ steps.buildnumber.outputs.RELEASE_NAME }}
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v2
24+
25+ - name : Detect Build Configuration
26+ id : configuration
27+ shell : pwsh
28+ run : |
29+ if ($env:github.ref -eq 'refs/heads/main') {
30+ Write-Host "Set build configuration to release"
31+
32+ Write-Output "BuildConfiguration=release" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
33+ Write-Output "BundlePlatforms=x86|x64|ARM" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
34+ } else {
35+ Write-Host "Set build configuration to debug"
36+
37+ Write-Output "BuildConfiguration=debug" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
38+ Write-Output "BundlePlatforms=x86" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
39+ }
40+
41+ - name : Set build number and release name
42+ id : buildnumber
43+ shell : pwsh
44+ run : |
45+ $CURRENTDATE = Get-Date -Format "yyyy.MM.dd"
46+ Write-Output "BUILD_NUMBER=$CURRENTDATE" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
47+
48+ $IS_BETA_RELEASE = '${{ inputs.IsBetaRelease }}'
49+ if ($IS_BETA_RELEASE -eq 'true') {
50+ Write-Host "Set release name to Beta:$CURRENTDATE.${{github.run_number}}"
51+ Write-Output "RELEASE_NAME=Beta:$CURRENTDATE.${{github.run_number}}" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
52+ } else {
53+ Write-Host "Set release name to $CURRENTDATE"
54+ Write-Output "RELEASE_NAME=$CURRENTDATE" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
55+ }
56+
57+ build :
58+ uses : ./.github/workflows/build.yml
59+ name : Build
60+ needs : configure
61+ with :
62+ build_configuration : ${{needs.configure.outputs.buildConfiguration}}
63+ bundle_Platforms : ${{ needs.configure.outputs.bundlePlatforms}}
64+ build_number : ${{ needs.configure.outputs.buildNumber}}
65+ secrets : inherit
0 commit comments