Skip to content

Commit

Permalink
update package version from pypi pipeline (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
shpaker authored Nov 12, 2022
1 parent 7176d62 commit 10743a6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Set up Python 3.9
uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.9"
-
name: Checkout
uses: actions/checkout@v2
-
name: dependencies
- uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: |
python -m pip install poetry==1.1.7
-
name: build
run: poetry build
-
name: publish
run: |
poetry config http-basic.pypi ${{ secrets.PYPI_LOGIN }} ${{ secrets.PYPI_PASS }}
poetry publish
echo "##[set-output name=name;]$(echo ${GITHUB_REPOSITORY#*/})"
echo "##[set-output name=ver;]$(echo ${GITHUB_REF#refs/*/})"
echo "##[set-output name=minor_ver;]$(TMP_VAR=${GITHUB_REF#refs/*/}; echo ${TMP_VAR%.*})"
echo "##[set-output name=major_ver;]$(TMP_VAR=${GITHUB_REF#refs/*/}; echo ${TMP_VAR%.*.*})"
echo "##[set-output name=sha;]$(git rev-parse --short "$GITHUB_SHA")"
id: extract_name_and_version
- run: sed -i 's/0.1.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' pyproject.toml
- run: head -n 3 pyproject.toml
- run: python -m pip install poetry==1.2.2
- run: poetry build
- run: poetry config http-basic.pypi ${{ secrets.PYPI_LOGIN }} ${{ secrets.PYPI_PASS }}
- run: poetry publish
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ repos:
- id: check-added-large-files
- id: check-json
- id: check-merge-conflict
- id: check-yaml
# - id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: forbid-new-submodules
- id: trailing-whitespace
exclude: ^.+(\.md)$
5 changes: 4 additions & 1 deletion makeqr/cli_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def func(

try:
qr.save(group_params["output"])
except (ValueError, OSError) as err:
except ValueError as err:
click.echo(str(err), color=True, err=True)
qr.save(f"{group_params['output']}.png")
except OSError as err:
click.echo(str(err), color=True, err=True)
sys.exit(1)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "makeqr"
version = "4.0.0rc1"
version = "0.1.0"
description = "Generate QR cards for any occasion"
authors = ["Aleksandr Shpak <[email protected]>"]
classifiers=[
Expand Down

0 comments on commit 10743a6

Please sign in to comment.