Skip to content

Commit

Permalink
Modify build-publish.yml to split build and publish into separate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfallan committed Dec 29, 2024
1 parent 3e24dc6 commit cae085a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
49 changes: 38 additions & 11 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ concurrency:
cancel-in-progress: false

jobs:
build-publish:
build:
runs-on: ${{ matrix.platform }}
# This environment is used for publishing on PyPI
environment: publish-pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
Expand All @@ -26,13 +21,13 @@ jobs:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Python (Linux)
if: matrix.platform == 'ubuntu-latest'
- name: Set up Python (not macOS)
if: matrix.platform != 'macos-latest'
uses: actions/setup-python@v4
with:
python-version: 3.13

- name: Install pyenv (macOS)
- name: Install pyenv (only macOS)
if: matrix.platform == 'macos-latest'
run: |
brew update
Expand All @@ -55,7 +50,39 @@ jobs:
cibuildwheel --output-dir dist
env:
CIBW_PLATFORM: ${{ matrix.platform == 'ubuntu-latest' && 'linux' || matrix.platform == 'macos-latest' && 'macos' }}


- name: Upload wheels as artifacts
uses: actions/upload-artifact@v3
with:
name: wheels-${{ matrix.platform }}
path: dist-${{ matrix.platform }}

publish:
runs-on: ubuntu-latest
needs: build
# This environment is used for publishing on PyPI
environment: publish-pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write

steps:
- name: Download Linux wheels
uses: actions/download-artifact@v3
with:
name: wheels-ubuntu-latest
path: dist-ubuntu-latest

- name: Download macOS wheels
uses: actions/download-artifact@v3
with:
name: wheels-macos-latest
path: dist-macos-latest

- name: Merge wheels
run: |
mkdir -p dist
mv dist-*-latest/* dist/
- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@release/v1

2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('seismic-rna', 'c', version: '0.22.2')
project('seismic-rna', 'c', version: '0.22.3')
python = import('python').find_installation(pure: false)

# Install Python package files.
Expand Down
2 changes: 1 addition & 1 deletion src/seismicrna/core/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re


__version__ = "0.22.2"
__version__ = "0.22.3"


def parse_version(version: str = __version__):
Expand Down

0 comments on commit cae085a

Please sign in to comment.