Skip to content

Commit

Permalink
Fix Python development releases, upgrade macOS runner (#356)
Browse files Browse the repository at this point in the history
* Fix twine not installed in wheel publish

* Fix CI not fetching tags for python builds

* Upgrade macos Github runner from 12 to 14

* Fix linux libraries filter value

* Skip build job if libraries filter is empty
  • Loading branch information
tlifschitz authored Nov 5, 2024
1 parent f9bc134 commit 745608f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ jobs:
runs-on: ubuntu-22.04
needs: [tests, examples]

# Skip the job if input is empty. If not there is an error building the matrix and depending jobs will not run:
# 'Error when evaluating 'strategy' for job 'build'. Matrix vector 'library' does not contain any values'
if: ${{ inputs.libraries != '[]' && inputs.libraries != '' }}
strategy:
fail-fast: false
max-parallel: 4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
tests:
runs-on: macos-12
runs-on: macos-14

steps:
- name: Clone Repository
Expand All @@ -22,7 +22,7 @@ jobs:
$GITHUB_WORKSPACE/build_test/bin/simpleble_test
examples:
runs-on: macos-12
runs-on: macos-14

steps:
- name: Clone Repository
Expand All @@ -35,7 +35,7 @@ jobs:
cmake --build $GITHUB_WORKSPACE/build --config Release --parallel 4
build:
runs-on: macos-12
runs-on: macos-14
needs: [tests, examples]

strategy:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
uses: ./.github/workflows/ci_wheels.yml
secrets: inherit
with:
os: macos-12
os: macos-14

rust:
runs-on: ${{ matrix.os }}
Expand All @@ -91,7 +91,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
os: [macos-12]
os: [macos-14]
arch: [arm64, x86_64]

steps:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ci_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ jobs:
# This is not inside pre-job because 'changes' variable is set by dorny/paths-filter to ALL the filters
# that match, so we need to have a job with only these three filters.
# Note that the filters are defined in a way that makes each of them depend on the previous one.
# If in main branch, all libraries are listed in the output even if there are no matching changes.
libraries:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-22.04
permissions:
pull-requests: read
outputs:
values: ${{ steps.filter.outputs.changes }}
values: ${{ github.ref == 'refs/heads/main' && '["simpledbus","simplebluez","simpleble"]' || steps.filter.outputs.changes }}
steps:
- name: Clone Repository
uses: actions/checkout@v4
Expand All @@ -126,15 +127,19 @@ jobs:
with:
filters: |
simpledbus: &simpledbus
- '.github/workflows/**'
- '.github/actions/**'
- 'simpledbus/**'
simplebluez: &simplebluez
- *simpledbus
- 'simplebluez/**'
simpleble: &simpleble
- *simplebluez
- 'simpleble/**'
- name: Debug Output
run: |
echo "Current branch: ${{ github.ref }}"
echo "Is main branch? ${{ github.ref == 'refs/heads/main' }}"
echo "Path filter changes: ${{ steps.filter.outputs.changes }}"
echo "Final libraries output: ${{ github.ref == 'refs/heads/main' && '["simpledbus","simplebluez","simpleble"]' || steps.filter.outputs.changes }}"
lint:
needs: pre_job
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -35,6 +38,9 @@ jobs:
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_python_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
merge-multiple: true

- name: Check Packages
run: twine check wheels/*.whl
run: |
pip3 install twine
twine check wheels/*.whl
- name: Publish packages
run: twine upload --skip-existing wheels/*.whl --verbose
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_release_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
file_glob: true

macos:
runs-on: macos-12
runs-on: macos-14

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
os: [ubuntu-22.04, windows-2022, macos-14]

steps:
- name: Clone repository
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Set up QEMU
if: runner.os == 'Linux'
Expand Down

0 comments on commit 745608f

Please sign in to comment.