From 3311b8222ac7e199ef3ff3118bdc09bd9e160be4 Mon Sep 17 00:00:00 2001 From: Jasper Date: Fri, 11 Aug 2023 02:01:09 +0200 Subject: [PATCH] Automated the releasing of all build artifacts on Github Release on GH test GH tags Use poetry version as release tag env env env Added executable build step Trigger Moved artifact release to pushes to main (i.e. release) --- .github/workflows/main.yml | 15 +++++++++++++++ .gitignore | 1 - README.md | 2 +- build.spec | 36 ++++++++++++++++++++++++++++++++++++ environment.yml | 6 +++--- pyproject.toml | 2 +- 6 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 build.spec diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f59bd99..0b5e606 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,6 +49,9 @@ jobs: - name: Installing Poetry environment run: poetry install + - name: Setting tag to package version + run: | + echo "VERSION=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV - name: Running pytest id: pytest run: poetry run pytest -v @@ -66,9 +69,21 @@ jobs: id: build run: poetry build if: steps.pytest.outcome == 'success' && steps.mypy.outcome == 'success' && steps.pylint.outcome == 'success' && steps.coverage.outcome == 'success' + - name: Authorize GitHub Actions to publish on PYPI run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} if: steps.build.outcome == 'success' && github.event_name == 'push' - name: Publish on PYPI run: poetry publish if: steps.build.outcome == 'success' && github.event_name == 'push' + - name: Make executable from wheel + run: poetry run pyinstaller ./build.spec + id: freeze + if: steps.build.outcome == 'success' && github.event_name == 'push' + - name: Publish on Github + uses: softprops/action-gh-release@v1 + with: + files: dist/* + tag_name: ${{ env.VERSION }} + prerelease: false + if: steps.build.outcome == 'success' && github.event_name == 'push' && steps.freeze.outcome == 'success' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1f487b1..1938e2c 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,6 @@ MANIFEST # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest -*.spec # Installer logs pip-log.txt diff --git a/README.md b/README.md index e6ae314..34dc124 100644 --- a/README.md +++ b/README.md @@ -91,5 +91,5 @@ If `libretro_finder` is called without any additional arguments, LibretroFinder ### Missing features? Have some feedback? Let me know! -- [Open a Github issue](https://github.com/jaspersiebring) +- [Open a Github issue](https://github.com/jaspersiebring/libretro_finder/issues) - [Message me on Reddit ](https://www.reddit.com/user/qtieb/) \ No newline at end of file diff --git a/build.spec b/build.spec new file mode 100644 index 0000000..ee1f8ea --- /dev/null +++ b/build.spec @@ -0,0 +1,36 @@ +# -*- mode: python ; coding: utf-8 -*- + +import gooey +gooey_root = os.path.dirname(gooey.__file__) + +block_cipher = None + +a = Analysis(['./libretro_finder/main.py'], + pathex=['./libretro_finder/main.py'], + binaries=[], + datas=[('./config', 'config')], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='libretro_finder', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + icon=os.path.join(gooey_root, 'images', 'program_icon.ico')) \ No newline at end of file diff --git a/environment.yml b/environment.yml index bb04bee..7c2241c 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,6 @@ name: bscraper channels: - - defaults + - conda-forge dependencies: - - python=3.11 - - poetry=1.4 + - python=3.8 + - poetry>=1.5 diff --git a/pyproject.toml b/pyproject.toml index c2e8e42..8966f90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "libretro-finder" -version = "0.2.2" +version = "0.2.3" description = "Simple tool that finds and prepares your BIOS files for usage with Libretro (or its RetroArch frontend)." authors = ["Jasper Siebring "] license = "GNU General Public License v3.0"