app-12333890279 #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "openHAB Build and Release app" | |
run-name: app-${{github.run_id }} | |
env: | |
BuildDirectory: '${{github.workspace}}\build' | |
ACTIONS_RUNNER_DEBUG: true | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
BuildConfiguration: | |
description: "Specifices if a release or debug package should be created." | |
type: choice | |
options: ["release", "debug"] | |
default: "release" | |
IsBetaRelease: | |
description: "Specifices if a beta release should be created." | |
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|ARM" | 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" | 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: | |
uses: ./.github/workflows/release.yml | |
needs: | |
- build | |
- configure | |
with: | |
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 |