Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
andfanilo committed Jun 5, 2023
1 parent eea7b91 commit 1ba7ae7
Show file tree
Hide file tree
Showing 8 changed files with 44,390 additions and 23 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish_new_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# Copied from https://github.com/randyzwitch/streamlit-folium/blob/master/.github/workflows/publish_PYPI_each_tag.yml and https://github.com/whitphx/streamlit-webrtc/blob/main/.github/workflows/publish.yml
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build streamlit-drawable-canvas JS
run: |
npm ci
npm run build
working-directory: streamlit_drawable_canvas/frontend
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pwd
python setup.py sdist bdist_wheel
twine upload dist/*
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ node_modules/
# Coverage directory used by tools like istanbul
coverage/

# Lockfiles
yarn.lock
*/package-lock.json

########################################################################
# JetBrains
########################################################################
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def readme() -> str:

setuptools.setup(
name="streamlit-drawable-canvas",
version="0.10.0",
version="0.9.3",
author="Fanilo ANDRIANASOLO",
author_email="andfanilo@gmail.com",
author_email="contact@andfanilo.com",
description="A Streamlit custom component for a free drawing canvas using Fabric.js.",
long_description=readme(),
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion streamlit_drawable_canvas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import streamlit.elements.image as st_image
from PIL import Image

_RELEASE = False # on packaging, pass this to True
_RELEASE = True # on packaging, pass this to True

if not _RELEASE:
_component_func = components.declare_component(
Expand Down
2 changes: 1 addition & 1 deletion streamlit_drawable_canvas/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

package-lock.json
# package-lock.json

# dependencies
/node_modules
Expand Down
Loading

0 comments on commit 1ba7ae7

Please sign in to comment.