Skip to content

Commit

Permalink
Merge pull request #60 from jugaad-py/fix-ci-cd
Browse files Browse the repository at this point in the history
changed publish
  • Loading branch information
sevakram authored Nov 19, 2023
2 parents 17e4039 + e66ceac commit 16fc396
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
53 changes: 33 additions & 20 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,41 @@
name: Upload Python Package

on:
release:
types: [created]

push:
branches:
- master
jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
cache-dependency-path: pyproject.toml
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install build
- name: Build distribution
run: python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
4 changes: 0 additions & 4 deletions tests/test_nse_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ def test_market_status():

def test_tick_data():
d = n.tick_data("HDFC")
assert "closePrice" in d
assert "identifier" in d
assert "grapthData" in d
d = n.tick_data("NIFTY 50", True)
assert "closePrice" in d
assert "grapthData" in d
assert "identifier" in d

def test_market_turnover():
d = n.market_turnover()
Expand Down

0 comments on commit 16fc396

Please sign in to comment.