Updates Versioning Pipeline
This commit is contained in:
35
.github/workflows/python-pypi-test-upload.yml
vendored
35
.github/workflows/python-pypi-test-upload.yml
vendored
@@ -1,35 +0,0 @@
|
|||||||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
||||||
|
|
||||||
name: Upload CrystalPol to PyPI Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ develop ]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
pypi-upload-test:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Set up Python 3.8
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
with:
|
|
||||||
python-version: "3.8"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip poetry
|
|
||||||
python -m poetry install
|
|
||||||
- name: Test with unittest
|
|
||||||
run: |
|
|
||||||
python -m poetry run python -m unittest -v
|
|
||||||
- name: Upload Pip Package
|
|
||||||
run: |
|
|
||||||
python -m poetry config repositories.testpypi https://test.pypi.org/legacy/
|
|
||||||
python -m poetry publish --build --username __token__ --password ${{secrets.PYPI_TEST_TOKEN}} --repository testpypi
|
|
||||||
74
.github/workflows/python-pypi-upload.yml
vendored
74
.github/workflows/python-pypi-upload.yml
vendored
@@ -4,32 +4,62 @@
|
|||||||
name: Upload CrystalPol to PyPI
|
name: Upload CrystalPol to PyPI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
pypi-upload:
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install poetry
|
||||||
|
run: pipx install poetry
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
- name: Set up Python 3.10
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
poetry self add "poetry-dynamic-versioning[plugin]"
|
||||||
|
if [ -f pyproject.toml ]; then poetry install; fi
|
||||||
|
- name: Run unittest
|
||||||
|
run: |
|
||||||
|
poetry run python -m unittest
|
||||||
|
|
||||||
steps:
|
pypi-upload:
|
||||||
- uses: actions/checkout@v3
|
needs: [test]
|
||||||
- name: Set up Python 3.8
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: actions/setup-python@v3
|
runs-on: ubuntu-latest
|
||||||
with:
|
steps:
|
||||||
python-version: "3.8"
|
- uses: actions/checkout@v3
|
||||||
- name: Install dependencies
|
with:
|
||||||
run: |
|
fetch-depth: 0
|
||||||
python -m pip install --upgrade pip poetry
|
- name: Install poetry
|
||||||
python -m poetry install
|
run: pipx install poetry
|
||||||
- name: Test with unittest
|
|
||||||
run: |
|
- name: Set up Python 3.10
|
||||||
python -m poetry run python -m unittest -v
|
uses: actions/setup-python@v3
|
||||||
- name: Upload Pip Package
|
with:
|
||||||
run: |
|
python-version: "3.10"
|
||||||
python -m poetry config repositories.pypi https://upload.pypi.org/legacy/
|
- name: Install dependencies
|
||||||
python -m poetry publish --build --username __token__ --password ${{secrets.PYPI_TOKEN}} --repository pypi
|
run: |
|
||||||
|
poetry self add "poetry-dynamic-versioning[plugin]"
|
||||||
|
if [ -f pyproject.toml ]; then poetry install; fi
|
||||||
|
- name: Build Python Package
|
||||||
|
run: |
|
||||||
|
poetry build -f sdist
|
||||||
|
poetry install
|
||||||
|
echo "Built CrystalPol - $(poetry version)"
|
||||||
|
- name: Configure PyPI
|
||||||
|
run: |
|
||||||
|
poetry config repositories.pypi https://upload.pypi.org/legacy/
|
||||||
|
poetry config pypi-token.pypi ${{secrets.PYPI_TOKEN}}
|
||||||
|
- name: Upload Python Package
|
||||||
|
run: |
|
||||||
|
poetry publish --repository pypi
|
||||||
30
.github/workflows/python-tests.yml
vendored
30
.github/workflows/python-tests.yml
vendored
@@ -1,30 +0,0 @@
|
|||||||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
||||||
|
|
||||||
name: Python application
|
|
||||||
|
|
||||||
on:
|
|
||||||
push
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
run-unitest:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up Python 3.8
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
with:
|
|
||||||
python-version: "3.8"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip poetry
|
|
||||||
python -m poetry install
|
|
||||||
- name: Test with unittest
|
|
||||||
run: |
|
|
||||||
poetry run python -m unittest -v
|
|
||||||
@@ -21,9 +21,13 @@ poethepoet = "^0.20.0"
|
|||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
crystalpol = "crystalpol.__main__:main"
|
crystalpol = "crystalpol.__main__:main"
|
||||||
|
|
||||||
|
[tool.poetry-dynamic-versioning]
|
||||||
|
enable = true
|
||||||
|
vcs = "git"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry_dynamic_versioning.backend"
|
||||||
|
|
||||||
[tool.poe.tasks]
|
[tool.poe.tasks]
|
||||||
hooks = "pre-commit install --config .pre-commit-config.yaml"
|
hooks = "pre-commit install --config .pre-commit-config.yaml"
|
||||||
|
|||||||
Reference in New Issue
Block a user