Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update cicd to publish to pypi #114

Merged
merged 11 commits into from
Feb 4, 2025
Merged
17 changes: 9 additions & 8 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
needs: ci

# Allow main and ci-cd-integration branches to trigger the release
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci-cd-integration'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

# Set up operating system
runs-on: ubuntu-latest
Expand All @@ -60,29 +60,29 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }} # forgive just added this

- name: Use Python Semantic Release to prepare release
id: release
uses: python-semantic-release/python-semantic-release@v8.7.0
uses: python-semantic-release/python-semantic-release@v8.3.0 # changed from 8.7 to 8.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true

# removed force = true
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ steps.release.outputs.released == 'true' }}
if: steps.release.outputs.released == 'true'
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
verbose: true
# removed verbose = true

- name: Test install from TestPyPI
if: ${{ steps.release.outputs.released == 'true' }}
if: steps.release.outputs.released == 'true'
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
healthsciencecalculator==${{ steps.release.outputs.version }}
healthsciencecalculator

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -95,3 +95,4 @@ jobs:
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"
jobs:
post_create_environment:
# Install poetry
Expand Down
Loading