Skip to content

Commit

Permalink
Merge pull request #9 from LBNL-ETA/develop
Browse files Browse the repository at this point in the history
Updated publish action.
  • Loading branch information
taoning committed Apr 25, 2023
2 parents ac2ede8 + ee2c989 commit 43ade04
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 10 deletions.
76 changes: 70 additions & 6 deletions .github/workflows/python-publish.yml
Expand Up @@ -13,23 +13,87 @@ on:
types: [published]

jobs:
deploy:

deploy_linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout pyradiance
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build Wheels
run: |
git submodule update --init --recursive
pip install requests wheel auditwheel pytest
python setup.py bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

deploy_macos:
runs-on: macos-latest

steps:
- name: Checkout pyradiance
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Build Wheels
run: |
git submodule update --init --recursive
pip install requests wheel auditwheel pytest
python setup.py bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

deploy_windows:
runs-on: windows-latest

steps:
- name: Checkout pyradiance
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build Wheels
run: |
git submodule update --init --recursive
pip install requests wheel auditwheel pytest
python setup.py bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
Expand Down
6 changes: 2 additions & 4 deletions pyradiance/anci.py
Expand Up @@ -17,10 +17,8 @@ def wrapper(*args, **kwargs):
try:
result = func(*args, **kwargs)
except CalledProcessError as e:
err = ""
if e.stderr is not None:
err = e.stderr.decode()
raise RuntimeError(f"An error occurred with exit code {e.returncode}: {err}")
errmsg = e.stderr or b""
raise RuntimeError(f"An error occurred with exit code {e.returncode}: {errmsg.decode()}")
else:
return result
return wrapper

0 comments on commit 43ade04

Please sign in to comment.