ta_formula v1.1.2 #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: PyPI | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: read | |
jobs: | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
# https://github.com/numpy/numpy/blob/main/.github/workflows/wheels.yml | |
build_wheels: | |
name: Build wheels ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
# Ensure that a wheel builder finishes even if another fails | |
fail-fast: false | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners | |
buildplat: | |
- [ubuntu-latest, manylinux_x86_64] | |
- [ubuntu-latest, musllinux_x86_64] | |
- [macos-13, macosx_x86_64] | |
- [macos-14, macosx_arm64] | |
# - [windows-2019, win_amd64] | |
# - [windows-2019, win32] | |
python: ["cp39"] # "cp310", "cp311", "cp312", "pp310", "cp313", "cp313t" | |
# exclude: | |
# # Don't build PyPy 32-bit windows | |
# - buildplat: [windows-2019, win32] | |
# python: "pp310" | |
# - buildplat: [ ubuntu-20.04, musllinux_x86_64] | |
# python: "pp310" | |
# - buildplat: [ macos-14, macosx_arm64] | |
# python: "pp310" | |
# - buildplat: [ windows-2019, win_amd64] | |
# python: "cp313t" | |
# - buildplat: [ windows-2019, win32] | |
# python: "cp313t" | |
# - buildplat: [ macos13, macosx_x86_64] | |
# python: "cp313t" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup macOS | |
if: matrix.buildplat[0] == 'macos-13' || matrix.buildplat[0] == 'macos-14' | |
run: | | |
# depending on libta_lib.0.0.0.dylib which is made on target os, so | |
# the build wheel must be target to the same os. | |
if [[ ${{ matrix.buildplat[0] }} == 'macos-14' ]]; then | |
CIBW="MACOSX_DEPLOYMENT_TARGET=14.0" | |
echo "CIBW_ENVIRONMENT_MACOS=$CIBW" >> "$GITHUB_ENV" | |
else | |
CIBW="MACOSX_DEPLOYMENT_TARGET=13.0" | |
echo "CIBW_ENVIRONMENT_MACOS=$CIBW" >> "$GITHUB_ENV" | |
fi | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | |
CIBW_BUILD_FRONTEND: "pip" | |
CIBW_BEFORE_BUILD_MACOS: bash ./tools/build_talib_from_source.bash | |
CIBW_BEFORE_BUILD_LINUX: bash ./tools/install_tools.bash && bash ./tools/build_talib_from_source.bash | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheel-${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }} | |
path: ./wheelhouse/*.whl | |
publish-to-pypi: | |
needs: | |
- build_sdist | |
- build_wheels | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/ta_formula | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- name: pypi-publish | |
uses: pypa/[email protected] | |
with: | |
skip-existing: true |