Skip to content

Commit

Permalink
Fix GitHub actions (#9)
Browse files Browse the repository at this point in the history
* publish.yml permisisons

* event publish.yml

event publish.yml

* setup.py updated to auto determine version from git

setup.py updated to auto determine version from git

setup.py updated to auto determine version from git

* fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow

fix workflow
  • Loading branch information
zdeneklapes committed Aug 7, 2023
1 parent fc306d7 commit 351a0e8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,31 @@ name: Publish to PyPI.org
on:
release:
types: [ published ]
workflow_dispatch:

permissions:
id-token: write

jobs:
pypi:
runs-on: ubuntu-latest
environment: Deploy
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: python3 -m pip install --upgrade build && python3 -m build
- name: Set up Python
uses: actions/setup-python@v4
- run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools wheel
python3 -m pip install --upgrade build && python3 -m build
python3 -m pip install --upgrade twine
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
print-hash: true
skip-existing: true
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import os
from setuptools import setup, find_packages
from subprocess import Popen, PIPE

directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

version = Popen("gh release view --jq '.tagName' --json tagName ", stdout=PIPE, stderr=PIPE, shell=True).stdout.read().decode().strip()

setup(
name='bazos',
version='0.0.1',
version=version,
use_scm_version=True,
description='Bazos API, that allows you to scrape bazos and upload products to bazos website.',
author='Zdenek Lapes',
license='MIT',
Expand Down

0 comments on commit 351a0e8

Please sign in to comment.