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

Github Actions #13

Merged
merged 13 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on:
workflow_dispatch:
workflow_call:
# push:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Build
run: |
poetry build
ls dist/*

- name: Create build-output artifact
uses: actions/upload-artifact@master
with:
name: build-output
path: dist/
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: deploy

on:
workflow_dispatch:
# push:


jobs:
build:
uses: kornpow/lnd-grpc-client/.github/workflows/build.yml@github_actions

deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download build-output artifact
uses: actions/download-artifact@master
with:
name: build-output
path: dist/

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/rebuild-protos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: rebuild-protos

on:
workflow_dispatch:
# push:

jobs:
multi:
runs-on: ubuntu-latest

steps:
- name: Checkout lnd-grpc-client
uses: actions/checkout@v3
with:
path: lnd-grpc-client

- uses: oprypin/find-latest-tag@v1
with:
repository: "lightningnetwork/lnd" # The repository to scan.
releases-only: true # We know that all relevant tags have a GitHub release for them.
id: lnd-latest # The step ID to refer to later.

- name: Checkout LND
uses: actions/checkout@v3
with:
repository: "lightningnetwork/lnd"
ref: ${{ steps.lnd-latest.outputs.tag }}
path: lnd

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install Deps
working-directory: ./lnd-grpc-client
run: |
poetry install


- name: Rebuild the Protos
run: |
export CLIENT_DIR=$(readlink -f lnd-grpc-client)
export APP_DIR=$(readlink -f lnd)
cd lnd-grpc-client
source .venv/bin/activate
python3 $CLIENT_DIR/rebuild_protos.py
git status

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
path: lnd-grpc-client
base: master
branch: protos/${{ steps.lnd-latest.outputs.tag }}
commit-message: "[automated] Regenerated LND proto files for version: ${{ steps.lnd-latest.outputs.tag }}"
title: "LND ${{ steps.lnd-latest.outputs.tag }}: Regenerated proto files"
body: "Updated the LND protos!"
reviewers: kornpow
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: test

on:
workflow_dispatch:
# push:


jobs:
multi:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ ENV/
# pycharm
.idea/

# vscode
.vscode/

.pytest_cache/

#
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ python3 rebuild_protos.py
poetry build
twine check dist/*
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```
```howdy
419 changes: 225 additions & 194 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude = ["lndgrpc/googleapis/*"]
lndgrpcclient_cli = "lndgrpc.cli:cli"

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.8.1,<4.0"
protobuf = "^3.15.8"
aiogrpc = "^1.8"
googleapis-common-protos = "^1.53.0"
Expand All @@ -26,3 +26,7 @@ protobuf3-to-dict = "^0.1.5"
yachalk = "^0.1.5"
click = "^8.1.3"
ptpython = "^3.0.20"

[tool.poetry.group.dev.dependencies]
sh = "^2.0.2"