Python package #34
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 build and publish a Python package using Twine to PyPI | |
# For more information see: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
name: Python package | |
on: | |
push: | |
tags: | |
- v* | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
os: [windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies - linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get install -y gfortran ninja-build | |
pip install build | |
- name: Install dependencies - windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
choco install mingw | |
choco install ninja | |
pip install build | |
- name: Build package | |
run: | | |
python -m build | |
- name: Upload package to artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist/* | |
# publish: | |
# needs: build | |
# runs-on: ubuntu-latest | |
# # Specifying a GitHub environment is optional, but strongly encouraged | |
# environment: release | |
# permissions: | |
# # IMPORTANT: this permission is mandatory for trusted publishing | |
# id-token: write | |
# steps: | |
# - name: Download package from artifacts | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: dist | |
# path: dist | |
# - name: Publish package to PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 |