-
-
Notifications
You must be signed in to change notification settings - Fork 55
79 lines (70 loc) · 2.67 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
name: 'openHAB Build and Release app'
run-name: app-${{github.run_id }}
env:
BUILD_NUMBER: '1970.1.1'
BuildDirectory: '${{github.workspace}}\build'
ACTIONS_RUNNER_DEBUG: true
on:
workflow_dispatch:
inputs:
BetaRelease:
description: 'Specifices if a beta release should be created.'
default: 'false'
required: false
BuildConfiguration:
description: 'Specifices if a release or debug package should be created.'
default: 'release'
required: false
IsBetaRelease:
description: 'Specifices if a beta release should be created.'
default: 'false'
required: false
jobs:
configure:
runs-on: ubuntu-latest
outputs:
build_configuration: ${{ steps.detect-build-configuration.outputs.BuildConfiguration }}
bundle_Platforms: ${{ steps.detect-build-configuration.outputs.BundlePlatforms }}
build_number: ${{ steps.set-buildnumbe.outputs.BUILD_NUMBER }}
release_name: ${{ steps.set-buildnumbe.outputs.ReleaseName }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Detect Build Configuration
id: detect-build-configuration
shell: pwsh
run: |
if ($env:github.ref -eq 'refs/heads/main') {
echo "BuildConfiguration=release" >> $GITHUB_OUTPUT
echo "BundlePlatforms=x86|x64|ARM" >> $GITHUB_OUTPUT
} else {
echo "BuildConfiguration=debug" >> $GITHUB_OUTPUT
echo "BundlePlatforms=x86" >> $GITHUB_OUTPUT
}
- name: Set build number and release name
id: set-buildnumbe
shell: pwsh
run: |
$CURRENTDATE = Get-Date -Format "yyyy.MM.dd"
Write-Host "BUILD_NUMBER=${CURRENTDATE}.${{github.run_number}}" >> $env:GITHUB_OUTPUT
$IS_BETA_RELEASE = ${{ inputs.IsBetaRelease }}
if ($IS_BETA_RELEASE) {
Write-Host "ReleaseName=Beta:${CURRENTDATE}.${{github.run_number}}" >> $env:GITHUB_OUTPUT
} else {
Write-Host "ReleaseName=${CURRENTDATE}.${{github.run_number}}" >> $env:GITHUB_OUTPUT
}
build:
uses: ./.github/workflows/build.yml
needs: configure
with:
build_configuration: ${{needs.configure.outputs.build_configuration}}
bundle_Platforms: ${{ needs.configure.outputs.bundle_Platforms}}
build_number: ${{ needs.configure.outputs.build_number}}
secrets: inherit
create_release:
needs: build
uses: ./.github/workflows/release.yml
with:
BetaRelease: false
BuildConfiguration: ${{needs.configure.outputs.build_configuration}}
build_number: ${{needs.configure.outputs.build_number}}