Skip to content

Publish on PyPi and release on GitHub #4

Publish on PyPi and release on GitHub

Publish on PyPi and release on GitHub #4

on:
# push:
# branches: [ main ]
workflow_dispatch:
name: Publish on PyPi and release on GitHub
jobs:
Version_Bumped:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.master_version_bumped.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Master version bumped
id: master_version_bumped
shell: bash -l {0}
run: |
cd misc
. ./check_version.sh
echo "version=${current_version}" >> $GITHUB_OUTPUT
Create_PyPi_Release:
runs-on: ubuntu-latest
needs: Version_Bumped
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Prepare distribution
shell: bash -l {0}
run: |
cd release/pypi
. ./prepare_pypi_wheel.sh
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_ALPHARAW_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Test PyPI test release
shell: bash -l {0}
run: |
cd release/pypi
. ./install_test_pypi_wheel.sh
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_ALPHARAW_TOKEN }}
Test_PyPi_Release:
name: Test_PyPi_version_on_${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: Create_PyPi_Release
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Test pip installation from PyPi
shell: bash -l {0}
run: |
cd release/pypi
. ./install_pypi_wheel.sh