Skip to content

Commit

Permalink
Update build and publish workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hofmann <[email protected]>
  • Loading branch information
hoffe86 committed Feb 25, 2024
1 parent ceb9480 commit 13aeacb
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: 'Build App Package'

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

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -113,4 +110,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: app
path: ${{env.BuildDirectory}}
path: ${{inputs.output_directory}}
16 changes: 15 additions & 1 deletion .github/workflows/openhab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,18 @@ jobs:
uses: ./.github/workflows/release.yml
with:
beta_release: ${{ inputs.IsBetaRelease }}
build_number: ${{needs.configure.outputs.buildNumber}}
build_number: ${{needs.configure.outputs.buildNumber}}

publish_beta:
needs: build
uses: ./.github/workflows/publish.yml
with:
environment: BETA
package_name: ""

publish_prod:
needs: publish_beta
uses: ./.github/workflows/publish.yml
with:
environment: PROD
package_name: ""
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Deploy App Package'

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

on:
workflow_call:
inputs:
environment:
type: string
description: 'Defines the environment for the app package'
required: true
package_name:
type: string
description: 'The name of the app package'
required: true
artifact_name:
type: string
description: 'The name of the artifact to download'
default: 'app'
artifact_directory:
type: string
description: 'Defines the output directory for the app package'
default: '${{github.workspace}}\packages\'

jobs:
deploy:
name: 'Deploy App Package'
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- name: Download a App Package from Build Artifacts
uses: actions/[email protected]
with:
name: ${{inputs.artifact_name}}
path: '${{env.BuildDirectory}}/${{inputs.artifact_directory}}/'

- uses: isaacrlevin/windows-store-action
name: Publish to Store
with:
tenant-id: ${{ secrets.AZURE_AD_TENANT_ID }}
client-id: ${{ secrets.AZURE_AD_APPLICATION_CLIENT_ID }}
client-secret: ${{ secrets.AZURE_AD_APPLICATION_SECRET }}
app-id: ${{ secrets.STORE_APP_ID }}
package-path: "${{ github.workspace }}/${{inputs.artifact_directory}}/${{inputs.package_name}}.appxupload"

0 comments on commit 13aeacb

Please sign in to comment.