Skip to content

Commit

Permalink
Create CI/CD GitHub Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Oct 3, 2023
1 parent 61a33d2 commit d214c5e
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: cd

on:
push:
tags:
- "v*"

jobs:
tagged-release:
name: Tagged Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10.x'
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.4.1'
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Install project
run: poetry install --no-dev
- name: Build a wheel
run: poetry build
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: Python Wheel
path: "dist/*.whl"
- name: Deploy release
uses: marvinpinto/action-automatic-releases@latest
with:
prerelease: false
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: |
dist/*.whl
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
poetry-version: [1.4.1]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install project
run: |
poetry install --no-dev
python -m pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build project
run: poetry build
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Pull requests welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](http://makeapullrequest.com)
[![MIT license](https://img.shields.io/github/license/rlaPHOENiX/pyd2v?style=flat)](https://github.com/rlaphoenix/pyd2v/blob/master/LICENSE)
[![Build status](https://github.com/rlaphoenix/pyd2v/actions/workflows/ci.yml/badge.svg)](https://github.com/rlaphoenix/pyd2v/actions/workflows/ci.yml)
[![Python versions](https://img.shields.io/badge/python-3.6%2B-informational)](https://python.org)
[![Codacy rating](https://www.codefactor.io/repository/github/rlaphoenix/pyd2v/badge)](https://www.codefactor.io/repository/github/rlaphoenix/pyd2v)
[![Contributors](https://img.shields.io/github/contributors/rlaphoenix/pyd2v)](https://github.com/rlaphoenix/pyd2v/graphs/contributors)
Expand Down

0 comments on commit d214c5e

Please sign in to comment.