Skip to content

Commit

Permalink
fix publishing #patch (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmichlo authored Jul 1, 2024
1 parent f204f64 commit f137ea3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: pre-commit
on: [pull_request]

on:
push:
tags: ["**"]
pull_request:
branches: ["**"]

jobs:
pre-commit:
Expand Down
36 changes: 23 additions & 13 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
# This workflow will upload a Python Package
# using Twine when a release is created




name: publish

on:
push:
tags: ['v*.*.*']
release:
types: [created]

jobs:
deploy: # publish

pypi-publish:
runs-on: ubuntu-latest

# for pypi publish
environment:
name: pypi
url: https://pypi.org/p/pydependence
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.9'

- name: Install dependencies
- name: install build deps
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python3 -m pip install build
python3 -m build
python3 -m twine upload dist/*
# publish files in ./dist folder
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_TOKEN }}
5 changes: 2 additions & 3 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ name: test

on:
push:
branches: [ "main", "dev*", "feature*", "fix*"]
tags: [ '*' ]
tags: ["**"]
pull_request:
branches: [ "main", "dev*", "feature*", "fix*"]
branches: ["**"]

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:

# this repo
- repo: https://github.com/nmichlo/pydependence
rev: 27d3bc750602c687948fca627383b0dd034b3fce
rev: v0.4.1
hooks:
- id: pydependence
args: ["pyproject.toml"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Add a pre-commit entry pointing to your pyproject.toml file or configuration fil

```yaml
- repo: https://github.com/nmichlo/pydependence
rev: v0.4.1
rev: v0.4.2
hooks:
- id: pydependence
args: ["pyproject.toml"]
Expand Down

0 comments on commit f137ea3

Please sign in to comment.