Skip to content

Commit

Permalink
Added CI pypi publishing workflow (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolflu05 authored Feb 15, 2024
1 parent 6fa48e0 commit 42ae02a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 12 deletions.
25 changes: 25 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# .github/release.yml

changelog:
categories:
- title: ":boom: Breaking Changes"
labels:
- Semver-Major
- breaking
- title: ":sparkles: New Features"
labels:
- Semver-Minor
- type/feature
- type/enhancement
- title: ":bug: Bug Fixes"
labels:
- Semver-Patch
- type/bug
- title: ":package: Devops / Setup / Docs Changes"
labels:
- type/setup
- type/documentation
- type/dependencies
- title: ":memo: Other Changes"
labels:
- "*"
50 changes: 41 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,60 @@
name: CI

on:
push:
pull_request:
push:
pull_request:
release:
types: [published]

jobs:
style:
name: Style checks
style-python:
name: "💄 Style: python"
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]

- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
with:
python-version: 3.7
python-version: "3.10"

- name: Install style check dependencies
run: |
pip install flake8==5.0.4
pip install pep8-naming==0.13.1
pip install flake8==7.0.0
pip install pep8-naming==0.13.3
- name: Check style
run: |
flake8 .
publish:
if: github.event_name == 'release' && github.event.action == 'published'
needs: [style-python]
name: 📦 Publish to PyPi
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/inventree-cups-plugin
permissions:
id-token: write

steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # [email protected]

- name: Setup python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # [email protected]
with:
python-version: "3.10"

- name: Install build dependencies
run: pip install --upgrade wheel setuptools twine build

- name: Build pip package
run: python3 -m build

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8 # [email protected]
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

0 comments on commit 42ae02a

Please sign in to comment.