Skip to content

Commit

Permalink
chore(ci): configure github action ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fyhertz committed Oct 6, 2022
1 parent 74f4711 commit c2d5d35
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 30 deletions.
148 changes: 148 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: 🚀 CI/CD

on:
push:

jobs:
test_and_build:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Load Cached Poetry
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-dependencies-v2

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true

- name: Load Cached Python Dependencies
uses: actions/cache@v2
with:
path: .venv
key: python-dependencies-${{ hashFiles('**/poetry.lock') }}

- name: Install Python Dependencies
run: poetry install

- name: Install APT Dependencies
uses: upciti/wakemeops-action@v1
with:
packages: |
debhelper
fakeroot
- name: Run black
run: poetry run black src tests --check

- name: Run isort
run: poetry run isort src tests --check

- name: Run flake8
run: poetry run flake8 src tests

- name: Run pytest
run: poetry run pytest --cov=src --cov-report=term-missing tests

- name: Generate coverage report
shell: bash
run: poetry run coverage xml

- uses: codecov/codecov-action@v2
with:
files: ./coverage.xml

- name: Build single binary application
run: |
poetry install --extras pyinstaller
poetry run poetry-dynamic-versioning
poetry run pyinstaller --onefile src/wheel2deb.py --name wheel2deb -s
dist/wheel2deb
mv dist/wheel2deb wheel2deb_linux_amd64
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: wheel2deb_linux_amd64
path: wheel2deb_linux_amd64
retention-days: 2

publish_release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [test_and_build]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install clog-cli
uses: upciti/wakemeops-action@v1
with:
packages: clog-cli

- name: Build Release Changelog
run: |
clog --setversion $(git tag --sort=creatordate | tail -n1) \
--from $(git tag --sort=creatordate | tail -n2 | head -n1) \
-o changelog.md \
-r https://github.com/upciti/wheel2deb
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: wheel2deb_linux_amd64

- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog.md
files: wheel2deb_linux_amd64

publish_pypi:
runs-on: ubuntu-18.04
needs: [test_and_build]
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Load Cached Poetry
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-dependencies-v2

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Get Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Build Distribution
run: |
poetry version "$RELEASE_VERSION"
poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# version.py is managed by setuptools-scm
src/_wheel2deb/version.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
## wheel2deb: python wheel to debian package converter
## wheel2deb

[![Build Status](https://travis-ci.org/parkoview/wheel2deb.svg?branch=master)](https://travis-ci.org/parkoview/wheel2deb)
[![Coverage Status](https://coveralls.io/repos/github/parkoview/wheel2deb/badge.svg?branch=master)](https://coveralls.io/github/parkoview/wheel2deb?branch=master)
![cicd](https://github.com/upciti/wheel2deb/actions/workflows/cicd.yml/badge.svg)
[![codecov](https://codecov.io/gh/upciti/wheel2deb/branch/main/graph/badge.svg)](https://codecov.io/gh/upciti/wheel2deb)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![PyPI version shields.io](https://img.shields.io/pypi/v/wheel2deb.svg)](https://pypi.python.org/pypi/wheel2deb/)
[![Downloads](https://static.pepy.tech/personalized-badge/wheel2deb?period=total&units=international_system&left_color=blue&right_color=green&left_text=Downloads)](https://pepy.tech/project/wheel2deb)

wheel2deb basically takes a list of wheels as input and produces a list of debian binary CPython packages (those prefixed with python- or python3-).
`wheel2deb` is a python wheel to debian package converter. It takes a list of wheels as input and produces a list of debian binary CPython packages (those prefixed with python- or python3-).

[![asciicast](https://asciinema.org/a/249779.svg)](https://asciinema.org/a/249779)

Expand Down Expand Up @@ -56,11 +57,9 @@ Keep in mind that you should only convert wheels that have been built for your d

wheel2deb is available from [pypi](https://pypi.org/project/wheel2deb/):

`pip install wheel2deb`

Docker images for jessie, stretch and buster are also available from the [docker hub](https://cloud.docker.com/u/parkoview/repository/docker/parkoview/wheel2deb):

`docker run -ti -v $(pwd):/data wheel2deb:stretch`
```shell
pipx install wheel2deb
```

## Features

Expand Down Expand Up @@ -89,10 +88,10 @@ Use `wheel2deb --help` and `wheel2deb build --help` to check all supported optio

## Bugs/Requests

Please use the [GitHub issue tracker](https://github.com/parkoview/wheel2deb/issues) to submit bugs or request features.
Please use the [GitHub issue tracker](https://github.com/upciti/wheel2deb/issues) to submit bugs or request features.

## License

Copyright Parkoview SA 2019-2021.
Copyright Parkoview SA 2019-2023.

Distributed under the terms of the [MIT](https://github.com/parkoview/wheel2deb/blob/master/LICENSE) license, wheel2deb is free and open source software.
Distributed under the terms of the [MIT](https://github.com/upciti/wheel2deb/blob/master/LICENSE) license, wheel2deb is free and open source software.
30 changes: 17 additions & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
python = ">=3.10,<3.11"
setuptools = "*"
wheel = "*"
pkginfo = "*"
Expand All @@ -28,7 +28,7 @@ packaging = "*"
dirsync = "*"
PyYAML = "^6"
Jinja2 = "^3"
pyinstaller = { version = "*", optional = true }
pyinstaller = { version = "5.4.1", optional = true }

[tool.poetry.extras]
pyinstaller = ["pyinstaller"]
Expand Down
1 change: 1 addition & 0 deletions src/_wheel2deb/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0"

0 comments on commit c2d5d35

Please sign in to comment.