Skip to content

Commit

Permalink
Feat: Option to manually specify the build type in the workflow (#2034)
Browse files Browse the repository at this point in the history
* Python bindings: Fix upload-artifact actions

* Github Action: Enable workflow_dispatch to manually trigger jobs to produce either Debug or Release builds
  • Loading branch information
Antelox authored Oct 17, 2024
1 parent 6fbbf30 commit 3691e33
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build-uc2.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
name: Build UC2

on:
workflow_dispatch:
inputs:
buildType:
description: 'Build Type'
required: false
default: ''
type: choice
options:
- 'Debug'
- 'Release'
push:
paths-ignore:
- ".gitignore"
Expand All @@ -15,8 +25,8 @@ on:
pull_request:

env:
# Build Debug mode if not tag release
BUILD_TYPE: ${{ startsWith(github.ref, 'refs/tags') && 'Release' || 'Debug' }}
# Specify build type either according to the tag release or manual override
BUILD_TYPE: ${{ inputs.buildType != '' && inputs.buildType || startsWith(github.ref, 'refs/tags') && 'Release' || 'Debug' }}

jobs:
Windows:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/build-wheels-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
name: Build wheels with cibuildwheel

on:
workflow_dispatch:
inputs:
debugMode:
description: 'Debug Mode'
required: false
default: ''
type: choice
options:
- '0'
- '1'
push:
paths-ignore:
- ".gitignore"
Expand All @@ -15,8 +25,8 @@ on:
pull_request:

env:
# Enable DEBUG flag if not tag release
UNICORN_DEBUG: ${{ startsWith(github.ref, 'refs/tags') && '0' || '1' }}
# Enable DEBUG flag either according to the tag release or manual override
UNICORN_DEBUG: ${{ inputs.debugMode != '' && inputs.debugMode || startsWith(github.ref, 'refs/tags') && '0' || '1' }}

jobs:
# job to be executed for every push - testing purpose
Expand Down Expand Up @@ -160,7 +170,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}-py38
path: ./wheelhouse/*.whl

# Job to be executed to build all wheels for all platforms/architectures/python versions only for tag release
Expand Down Expand Up @@ -315,7 +325,7 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}-all
path: ./wheelhouse/*.whl

make_sdist:
Expand All @@ -335,6 +345,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: sdist-archive
path: bindings/python/dist/*.tar.gz

publish:
Expand Down

0 comments on commit 3691e33

Please sign in to comment.