ODME release version #1279
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
name: Build and upload Windows Python Package | |
on: [pull_request, release] | |
jobs: | |
deploy: | |
runs-on: windows-2019 | |
env: | |
HAS_SECRETS: ${{ secrets.AWS_SECRET_ACCESS_KEY != '' }} | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
architecture: ['x64'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel twine | |
pip install -r requirements.txt | |
pip install -r requirements_additional.txt | |
- name: Build | |
run: python setup.py bdist_wheel | |
- name: Stores artifacts along with the workflow result | |
# if: ${{ github.event_name == 'push'}} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: library | |
path: dist/*.whl | |
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` | |
- name: Publish | |
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') }} | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: twine upload dist/*.whl |