Skip to content

Commit

Permalink
Add support for force release in GitHub workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hofmann <[email protected]>
  • Loading branch information
hoffe86 committed Dec 30, 2024
1 parent d684ee0 commit ce2d162
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/openhab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
description: "Specifies if a beta release should be created."
type: "boolean"
default: false
create_release:
description: "Specifies if a release should be created even if the branch is not main."
type: "boolean"
default: false

jobs:
configure:
Expand Down Expand Up @@ -82,6 +86,7 @@ jobs:
- build
- configure
with:
force_release: ${{ inputs.create_release }}
beta_release: ${{ inputs.IsBetaRelease }}
build_number: ${{ needs.configure.outputs.buildNumber }}

Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: App Release

env:
BuildDirectory: '${{github.workspace}}\build'

on:
on:
workflow_call:
inputs:
force_release:
description: 'Specifies if a release should be created even if the branch is not main.'
type: boolean
default: false
required: false
beta_release:
description: 'Specifies if a beta release should be created.'
type: boolean
Expand All @@ -15,12 +20,12 @@ on:
type: string
description: 'The build number to use'
required: true

jobs:
release:
name: 'Creates an app release'
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases/beta'
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases/beta' || inputs.force_release == true
steps:
- name: Download a App Package from Build Artifacts
uses: actions/[email protected]
Expand All @@ -35,4 +40,4 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{inputs.beta_release}}
automatic_release_tag: ${{inputs.build_number}}
title: ${{inputs.build_number}}
title: ${{inputs.build_number}}

0 comments on commit ce2d162

Please sign in to comment.