Skip to content

Commit

Permalink
build: add CD workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Dec 16, 2023
1 parent c1a36fa commit 06e8401
Showing 1 changed file with 70 additions and 41 deletions.
111 changes: 70 additions & 41 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,44 +40,73 @@ jobs:
- name: Build documentation
run: poetry run make html --directory docs/

# Continuous-Development:
# needs: Continuous-Integration

# if: github.event_name == 'push' && github.ref == 'refs/heads/main'

# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0

# - name: Set up Python 3.12
# uses: actions/setup-python@v2
# with:
# python-version: 3.12

# - name: Install poetry
# uses: snok/install-poetry@v1

# - name: Install package
# run: poetry install

# - name: Build package
# run: poetry build

# - name: Publish package
# uses: pypa/gh-action-pypi-publish@27a0a2a
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
# repository_url: https://upload.pypi.org/legacy/
# build_dir: ./dist

# - name: Publish documentation
# uses: maxheld83/ghpages@v0.2.1
# with:
# build_dir: docs/_build/html
# target_branch: gh-pages
# committer_name: "GitHub Actions"
# committer_email: "
Continuous-Development:
needs: Continuous-Integration

if: github.event_name == 'push' && github.ref == 'refs/heads/main'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Install poetry
uses: snok/install-poetry@v1

- name: Install package
run: poetry install

- name: Build package
run: poetry build

- name: Use Python Semantic Release to prepare release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
poetry run semantic-release publish
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Test install from TestPyPI
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
nbiatoolkit
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}


# - name: Publish package
# uses: pypa/gh-action-pypi-publish@27a0a2a
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
# repository_url: https://upload.pypi.org/legacy/
# build_dir: ./dist

# - name: Publish documentation
# uses: maxheld83/ghpages@v0.2.1
# with:
# build_dir: docs/_build/html
# target_branch: gh-pages
# committer_name: "GitHub Actions"
# committer_email: "jermiahjoseph98@gmail.com"

0 comments on commit 06e8401

Please sign in to comment.