Feat: Option to manually specify the build type in the workflow (#2034)

* Python bindings: Fix upload-artifact actions

* Github Action: Enable workflow_dispatch to manually trigger jobs to produce either Debug or Release builds
This commit is contained in:
@Antelox 2024-10-17 15:15:56 +02:00 committed by GitHub
parent 6fbbf3089a
commit 3691e33a0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 6 deletions

View File

@ -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"
@ -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:

View File

@ -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"
@ -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
@ -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
@ -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:
@ -335,6 +345,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: sdist-archive
path: bindings/python/dist/*.tar.gz
publish: