Skip to content

create release workflow for windows and macos #37

create release workflow for windows and macos

create release workflow for windows and macos #37

Workflow file for this run

name: Pre-release TypedUnits
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
create_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create version
run: |
mkdir version
echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version/version.txt
cat version/version.txt
- uses: actions/upload-artifact@master
with:
name: version-file
path: version
build_wheels:
runs-on: ${{ matrix.os }}
needs: [create_version]
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build cibuildwheel
- uses: actions/download-artifact@master
with:
name: version-file
path: version
- name: Build package
env:
CIBW_BUILD: "cp310*"
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: python-wheels
path: ./wheelhouse/*.whl
release-wheels:
name: Publish all wheels
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: python-wheels
path: wheelhouse/
- name: Publish package to testpypi
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
repository_url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages_dir: wheelhouse/
# - name: Publish package to pypi
# uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages_dir: wheelhouse/