-
-
Notifications
You must be signed in to change notification settings - Fork 55
112 lines (100 loc) · 3.87 KB
/
openhab.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: "openHAB Build and Release app"
run-name: run-${{github.head_ref || github.ref_name}}-${{github.run_number}}
env:
BuildDirectory: '${{github.workspace}}\build'
ACTIONS_RUNNER_DEBUG: true
on:
push:
branches:
- main
workflow_dispatch:
inputs:
BuildConfiguration:
description: "Specifies if a release or debug package should be created."
type: choice
options: ["release", "debug"]
default: "release"
IsBetaRelease:
description: "Create store beta release."
type: "boolean"
default: false
create_release:
description: "Create release even if the branch is not main."
type: "boolean"
default: false
jobs:
configure:
name: Configure Build
runs-on: ubuntu-latest
outputs:
buildConfiguration: ${{ steps.configuration.outputs.BuildConfiguration }}
bundlePlatforms: ${{ steps.configuration.outputs.BundlePlatforms }}
buildNumber: ${{ steps.buildnumber.outputs.BUILD_NUMBER }}
releaseName: ${{ steps.buildnumber.outputs.RELEASE_NAME }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Detect Build Configuration
id: configuration
shell: pwsh
run: |
if ($env:github.ref -eq 'refs/heads/main') {
Write-Host "Set build configuration to release"
Write-Output "BuildConfiguration=release" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
Write-Output "BundlePlatforms=x86|x64|arm64" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
} else {
Write-Host "Set build configuration to debug"
Write-Output "BuildConfiguration=debug" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
Write-Output "BundlePlatforms=x86|x64|arm64" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
}
- name: Set build number and release name
id: buildnumber
shell: pwsh
run: |
$CURRENTDATE = Get-Date -Format "yyyy.MM.dd"
Write-Output "BUILD_NUMBER=$CURRENTDATE" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
$IS_BETA_RELEASE = '${{ inputs.IsBetaRelease }}'
if ($IS_BETA_RELEASE -eq 'true') {
Write-Host "Set release name to Beta:$CURRENTDATE.${{github.run_number}}"
Write-Output "RELEASE_NAME=Beta:$CURRENTDATE.${{github.run_number}}" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
} else {
Write-Host "Set release name to $CURRENTDATE"
Write-Output "RELEASE_NAME=$CURRENTDATE" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
}
build:
uses: ./.github/workflows/build.yml
name: Build
needs: configure
with:
build_configuration: ${{needs.configure.outputs.buildConfiguration}}
bundle_Platforms: ${{ needs.configure.outputs.bundlePlatforms}}
build_number: ${{ needs.configure.outputs.buildNumber}}
secrets: inherit
create_release:
name: Create Release
uses: ./.github/workflows/release.yml
needs:
- build
- configure
with:
force_release: ${{ inputs.create_release }}
beta_release: ${{ inputs.IsBetaRelease }}
build_number: ${{ needs.configure.outputs.buildNumber }}
# publish_beta:
# uses: ./.github/workflows/publish.yml
# needs:
# - build
# - configure
# with:
# environment: BETA
# package_name: "openHAB.Windows_${{needs.configure.outputs.buildNumber}}_x86_x64_arm_bundle"
# secrets: inherit
# publish_prod:
# uses: ./.github/workflows/publish.yml
# needs:
# - publish_beta
# - configure
# with:
# environment: PROD
# package_name: "openHAB.Windows_${{needs.configure.outputs.buildNumber}}_x86_x64_arm_bundle"
# secrets: inherit