Skip to content

Commit

Permalink
Merge pull request #18 from fabiobarkoski/packaging
Browse files Browse the repository at this point in the history
build and publish package using github actions
  • Loading branch information
faermanj authored Apr 17, 2024
2 parents 5f9228a + 6b25d50 commit 8afc17d
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and publish packages

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
strategy:
matrix:
package: [upcli, uplib]
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- run: pip install build

- name: build ${{ matrix.package }}
run: |
cd {{ matrix.package }}
python -m build
- uses: actions/upload-artifact@v4
with:
path: ./${{ matrix.package }}/dist/*

- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

release:
needs: [publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
#pattern: *.whl
merge-multiple: true
path: dist

- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/

24 changes: 22 additions & 2 deletions upcli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
[tool.poetry]
name = "up"
version = "0.2.19"
description = ""
description = "Unified and Pluggable CLI"
authors = ["Julio Faerman <jufaerma@redhat.com>"]
maintainers = ["Julio Faerman <jufaerma@redhat.com>"]
readme = "README.md"
license = "MIT"
homepage = "https://github.com/CaravanaCloud/up"
repository = "https://github.com/CaravanaCloud/up"
documentation = "https://github.com/CaravanaCloud/up#documentation"
keywords = ["CLI"]
classifiers = [
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Topic :: Utilities"
]
#packages = [
# { include = "up_cli", from="./up_cli/"}
#]

[tool.poetry.urls]
"Bug Tracker" = "https://github.com/CaravanaCloud/up/issues"

[tool.poetry.dependencies]
python = "^3.12"
uplib = "^0.2.19"
Expand All @@ -22,4 +42,4 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
up = "up.main:cli_main"
up = "up.main:cli_main"
3 changes: 3 additions & 0 deletions uplib/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "uplib"
version = "0.2.19"
description = ""
authors = ["Julio Faerman <356476+faermanj@users.noreply.github.com>"]
include = [
"up.yaml"
]

[tool.poetry.dependencies]
python = "^3.12"
Expand Down

0 comments on commit 8afc17d

Please sign in to comment.