-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from iosefa/hotfix/gh-actions
Add separate workflows for building and publishing Python package
- Loading branch information
Showing
5 changed files
with
54 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
name: Publish Python Package | ||
name: Build and Test Python Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: Install Miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
python-version: '3.x' | ||
auto-update-conda: true | ||
python-version: "3.10" | ||
channels: conda-forge | ||
|
||
- name: Install build dependencies | ||
- name: Create Conda environment with Python 3.10 and PDAL | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
conda create --name pyforestscan_env python=3.10 pdal gdal -c conda-forge -v | ||
- name: Run tests | ||
- name: Activate Conda environment and install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
conda activate pyforestscan_env | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
pytest | ||
- name: Publish to PyPI | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
- name: Run tests | ||
shell: bash -l {0} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* -u __token__ -p $PYPI_TOKEN | ||
conda activate pyforestscan_env | ||
pytest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Publish Python Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Publish to PyPI | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* -u __token__ -p $PYPI_TOKEN |
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 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
Binary file not shown.