diff --git a/.github/workflows/itch-publish.yml b/.github/workflows/itch-publish.yml new file mode 100644 index 00000000..bc067088 --- /dev/null +++ b/.github/workflows/itch-publish.yml @@ -0,0 +1,62 @@ +name: Upload itch.io Package + +on: + workflow_dispatch: + inputs: + pkg_name: + description: the name of the project + type: string + required: true + # pkg_folder: + # description: the folder containing the pyproject.toml file + # type: string + # required: true + workflow_call: + inputs: + pkg_name: + description: the name of the project + type: string + required: true + # pkg_folder: + # description: the folder containing the pyproject.toml file + # type: string + # required: true + # release: + # types: [published] + +permissions: + contents: read + +jobs: + release-build: + # runs-on: ubuntu-latest + runs-on: self-hosted + + # defaults: + # run: + # working-directory: ${{ inputs.pkg_folder }} + + steps: + - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.x" + - name: Install Butler + shell: bash + run: | + # Download the latest stable version + curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default + unzip butler.zip + chmod +x butler + - name: create web package + shell: bash + run: | + tools/webExporterInit.sh + - name: Upload to itch.io + env: + BUTLER_CREDENTIALS: ${{ secrets.ITCHIO_TOKEN }} + shell: bash + run: | + echo ${BUTLER_CREDENTIALS} > ~/.config/itch/butler_creds + ./butler push dist/* ${{ secrets.ITCHIO_USER }}/${{ inputs.pkg_name }}:html5 + ./butler logout --assume-yes diff --git a/.github/workflows/release-sandbox-bin.yml b/.github/workflows/release-sandbox-bin.yml index e2e7dbf1..63515d9d 100644 --- a/.github/workflows/release-sandbox-bin.yml +++ b/.github/workflows/release-sandbox-bin.yml @@ -1,4 +1,4 @@ -name: Release Sandbox +name: Release Sandbox Binaries on: workflow_dispatch: diff --git a/apps/dumbPaintTool/dumbPaintTool/web.ttk.package.json b/apps/dumbPaintTool/dumbPaintTool/web.ttk.package.json deleted file mode 100644 index ce54d0af..00000000 --- a/apps/dumbPaintTool/dumbPaintTool/web.ttk.package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "libs" : [ - {"pkg" :"bin/TermTk.tgz", - "name": "TermTk"}, - {"pkg" :"bin/DPT.tgz", - "name": "Dumb Paint Tool"} - ], - "pkgs" : [ - "Pillow" - ], - "main": "dumbPaintTool.py" -} \ No newline at end of file diff --git a/apps/dumbPaintTool/main.py b/apps/dumbPaintTool/main.py new file mode 100644 index 00000000..6cc501f5 --- /dev/null +++ b/apps/dumbPaintTool/main.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# MIT License +# +# Copyright (c) 2023 Eugenio Parodi +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import sys,os +sys.path.append(os.path.join(sys.path[0],'../../')) + +from dumbPaintTool.app import main + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/apps/dumbPaintTool/web.ttk.package.json b/apps/dumbPaintTool/web.ttk.package.json new file mode 100644 index 00000000..5742bd7f --- /dev/null +++ b/apps/dumbPaintTool/web.ttk.package.json @@ -0,0 +1,10 @@ +{ + "libs" : [ + {"pkg" :"bin/TermTk.tgz", "name": "TermTk"}, + {"pkg" :"bin/DPT.tgz", "name": "Dumb Paint Tool"} + ], + "pkgs" : [ + "Pillow" + ], + "main": "main.py" +} \ No newline at end of file diff --git a/tools/check.import.sh b/tools/check.import.sh index ffc975f8..8edb2c77 100755 --- a/tools/check.import.sh +++ b/tools/check.import.sh @@ -1,7 +1,7 @@ #!/bin/sh __check(){ - grep -r -e "^import" -e "^from" TermTk | + grep -r -e "^import" -e "^from" libs/pyTermTk/TermTk | grep -v -e "from TermTk" -e "import TermTk" | grep -v "from typing import" | grep -v "__init__.py:from \.[^ ]* *import" | diff --git a/tools/webExporterInit.sh b/tools/webExporterInit.sh index 5ad72ada..8892fc31 100755 --- a/tools/webExporterInit.sh +++ b/tools/webExporterInit.sh @@ -43,8 +43,6 @@ echo Name: ${_NAME} mkdir -p ${_TMP_PATH} rm -rf ${_TMP_PATH}/* itchExport.zip -${_TOOLS_BASE_PATH}/prepareBuild.sh release - mkdir -p ${_TMP_PATH}/bin \ ${_TMP_PATH}/www/pyodide \ ${_TMP_PATH}/www/xterm/ \ @@ -62,7 +60,7 @@ function _download { _F=$2 if [ -f tests/sandbox/${_F} ] ; then cp tests/sandbox/${_F} ${_P} ; - else wget -P ${_P} https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/${_F}; + else wget -P ${_P} https://ceccopierangiolieugenio.github.io/pyTermTk-Docs/sandbox/${_F}; fi ; }; @@ -100,13 +98,15 @@ _download ${_TMP_PATH}/www/fonts/opentype/ www/fonts/opentype/3270-Regular.otf _download ${_TMP_PATH}/www/ www/favicon.ico - -tar cvzf ${_TMP_PATH}/bin/TermTk.tgz --exclude='__pycache__' --transform "s,^.*TermTk/,TermTk/," ${_TMP_PATH}/TermTk -tar cvzf ${_TMP_PATH}/bin/DPT.tgz --exclude='__pycache__' --transform "s,^.*/dumbPaintTool,dumbPaintTool," \ - ${_APPS_PATH}/dumbPaintTool.py \ - ${_APPS_PATH}/dumbPaintTool/*.py \ - ${_APPS_PATH}/dumbPaintTool/app \ - ${_APPS_PATH}/dumbPaintTool/tui +cd ${_BASE_PATH}/libs/pyTermTk/ +tar -cvzf ${_TMP_PATH}/bin/TermTk.tgz --exclude='__pycache__' TermTk +cd ${_APPS_PATH}/dumbPaintTool +tar -cvzf ${_TMP_PATH}/bin/DPT.tgz --exclude='__pycache__' \ + dumbPaintTool/*.py \ + dumbPaintTool/app \ + dumbPaintTool/tui \ + main.py +cd ${_BASE_PATH} cp ${_APPS_PATH}/dumbPaintTool/web.ttk.package.json ${_TMP_PATH}