Skip to content

Commit

Permalink
Bugfix/use poetry (#4)
Browse files Browse the repository at this point in the history
* actually add .py files to build

* switched to poetry

* remove pdm lock file

* typo

* updated poetry step
  • Loading branch information
SamRWest authored Jul 4, 2024
1 parent e515880 commit e7b0394
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 188 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:
push:
branches:
- main
- '*'
tags:
- '*.*.*'

Expand All @@ -18,6 +18,9 @@ env:
PUBLISH_USER: ${{secrets.PRIVATE_PYPI_PUBLISH_USER}}
PUBLISH_PASSWORD: ${{secrets.PRIVATE_PYPI_PUBLISH_PASSWORD}}

POETRY_VERSION: 1.8.3
PYTHON_VERSION: 3.9

jobs:
build:

Expand All @@ -29,22 +32,22 @@ jobs:
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: ${{env.PYTHON_VERSION}}

- name: Install PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.9'
cache: true
- name: Install Poetry
run: |
pip install --user pipx
pipx install poetry==${{ env.POETRY_VERSION }}
poetry config virtualenvs.in-project true
- name: Install dependencies
run: pdm install
run: poetry install

- name: Run pytest
run: pdm run pytest
run: poetry run pytest

- name: Build
run: pdm build
run: poetry build

- name: Create Release from Tag
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -55,6 +58,14 @@ jobs:
draft: false
prerelease: false

# - name: Publish to PyPI
# if: startsWith(github.ref, 'refs/tags/')
# run: poetry publish

- name: Publish to Private Package Index
if: startsWith(github.ref, 'refs/tags/')
run: pdm publish --repository https://${{env.PUBLISH_USER}}:${{env.PUBLISH_PASSWORD}}@pkgs.dev.azure.com/csiro-energy/csiro-energy/_packaging/csiro-python-packages/pypi/upload
continue-on-error: true
run:
poetry config repositories.csiroenergy ${{env.PUBLISH_URL}}
poetry config http-basic.csiroenergy ${{env.PUBLISH_USER}} ${{env.PUBLISH_PASSWORD}}
poetry publish --build -r csiroenergy
150 changes: 0 additions & 150 deletions pdm.lock

This file was deleted.

Loading

0 comments on commit e7b0394

Please sign in to comment.