mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
py: Update the PyPI job to use poetry and correct versions
Let's use poetry when we already use it for everything else. Changelog-None
This commit is contained in:
parent
20392ae526
commit
c673c092dc
4 changed files with 22 additions and 17 deletions
36
.github/workflows/pypi.yml
vendored
36
.github/workflows/pypi.yml
vendored
|
@ -38,35 +38,37 @@ jobs:
|
|||
with:
|
||||
python-version: 3.7
|
||||
|
||||
- name: Install pypa/build
|
||||
- name: Install pypa/build and poetry
|
||||
run: >-
|
||||
python -m pip install build --user
|
||||
python -m pip install build poetry --user
|
||||
|
||||
- name: Build a binary wheel and a source tarball
|
||||
env:
|
||||
WORKDIR: ${{ matrix.WORKDIR }}
|
||||
run: >-
|
||||
cd ${{ env.WORKDIR}} &&
|
||||
python -m build --sdist --wheel --outdir dist/ .
|
||||
run: |
|
||||
export VERSION=$(git describe --abbrev=0).post$(git describe --abbrev=1 | awk -F "-" '{print $2}')
|
||||
cd ${{ env.WORKDIR}}
|
||||
poetry version $VERSION
|
||||
poetry build
|
||||
|
||||
- name: Publish distribution 📦 to Test PyPI
|
||||
if: github.repository == 'ElementsProject/lightning'
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
env:
|
||||
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||
WORKDIR: ${{ matrix.WORKDIR }}
|
||||
with:
|
||||
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||
repository_url: https://test.pypi.org/legacy/
|
||||
packages_dir: "${{ env.WORKDIR}}/dist"
|
||||
skip_existing: true
|
||||
run: |
|
||||
cd ${{ env.WORKDIR}}
|
||||
poetry config repositories.testpypi https://test.pypi.org/legacy/
|
||||
poetry publish --repository testpypi --no-interaction
|
||||
|
||||
- name: Publish distribution 📦 to PyPI
|
||||
if: startsWith(github.ref, 'refs/tags') && github.repository == 'ElementsProject/lightning'
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
env:
|
||||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
|
||||
WORKDIR: ${{ matrix.WORKDIR }}
|
||||
with:
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
packages_dir: "${{ env.WORKDIR}}/dist"
|
||||
# We should never have a conflict here, the version tags are unique
|
||||
skip_existing: false
|
||||
run: |
|
||||
cd ${{ env.WORKDIR}}
|
||||
export VERSION=$(git describe --abbrev=0)
|
||||
poetry version $VERSION
|
||||
poetry config repositories.testpypi https://test.pypi.org/legacy/
|
||||
poetry publish --repository testpypi --no-interaction
|
||||
|
|
|
@ -4,6 +4,7 @@ version = "0.10.2.post1"
|
|||
description = "Client library and plugin library for c-lightning"
|
||||
authors = ["Christian Decker <decker.christian@gmail.com>"]
|
||||
license = "BSD-MIT"
|
||||
readme = "README.md"
|
||||
|
||||
packages = [
|
||||
{ include = "pyln/client" },
|
||||
|
|
|
@ -4,6 +4,7 @@ version = "0.10.2.post1"
|
|||
description = "This package implements some of the Lightning Network protocol in pure python. It is intended for protocol testing and some minor tooling only. It is not deemed secure enough to handle any amount of real funds (you have been warned!)."
|
||||
authors = ["Christian Decker <decker.christian@gmail.com>"]
|
||||
license = "BSD-MIT"
|
||||
readme = "README.md"
|
||||
|
||||
packages = [
|
||||
{ include = "pyln/proto" },
|
||||
|
|
|
@ -4,6 +4,7 @@ version = "0.10.2"
|
|||
description = "Test your c-lightning integration, plugins or whatever you want"
|
||||
authors = ["Christian Decker <decker.christian@gmail.com>"]
|
||||
license = "BSD-MIT"
|
||||
readme = "README.md"
|
||||
|
||||
packages = [
|
||||
{ include = "pyln/testing" },
|
||||
|
|
Loading…
Add table
Reference in a new issue