Skip to content

Commit

Permalink
Merge pull request #79 from martinhoyer/ci
Browse files Browse the repository at this point in the history
Add pypi publish and pre-commit workflows
  • Loading branch information
maurizio-lombardi authored Sep 11, 2024
2 parents abbf62f + 790932e commit de3532f
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: pypi-release

on:
release:
types:
- published
workflow_dispatch:
inputs:
ref:
description: 'Branch, tag or SHA to checkout'
required: true
default: 'master'

jobs:
pypi-publish:
runs-on: ubuntu-latest

permissions:
id-token: write # Needed for trusted publishing

environment:
name: pypi
url: https://pypi.org/p/configshell-fb

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref || github.ref }}

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build a binary wheel and a source tarball
run: |
python -m pip install hatch
hatch build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.4.4
rev: v0.6.4
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion configshell_fb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Providing backwards compatibility for modules importing 'configshell_fb'

from configshell import Console, Log, ConfigNode, ExecutionError, Prefs, ConfigShell
from configshell import ConfigNode, ConfigShell, Console, ExecutionError, Log, Prefs

__all__ = [
'Console',
Expand Down

0 comments on commit de3532f

Please sign in to comment.