From 880ad9ae8c8669ba9ddf02d59b834025ceee3f25 Mon Sep 17 00:00:00 2001 From: sparanoid Date: Sun, 5 Nov 2023 11:08:03 -0800 Subject: [PATCH] feat: add scripts --- .github/workflows/build.yml | 20 ++++---------------- README.md | 2 +- scripts/build | 12 ++++++++++++ scripts/install | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 17 deletions(-) create mode 100755 scripts/build create mode 100755 scripts/install diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ca81d9..a18d77f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ -name: Publish Python distribution to PyPI and TestPyPI +name: Publish on: push @@ -14,15 +14,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.x" - # - name: "Install dependencies" - # run: "scripts/install" - # - name: "Build package & docs" - # run: "scripts/build" - # - name: "Publish to PyPI & deploy docs" - # run: "scripts/publish" - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - name: Install pypa/build run: >- @@ -39,7 +30,7 @@ jobs: path: dist/ publish-to-testpypi: - name: Publish Python distribution to TestPyPI + name: Publish to TestPyPI needs: - build runs-on: ubuntu-latest @@ -63,8 +54,7 @@ jobs: repository-url: https://test.pypi.org/legacy/ publish-to-pypi: - name: >- - Publish Python distribution to PyPI + name: Publish to PyPI if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes needs: - build @@ -87,9 +77,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 github-release: - name: >- - Sign the Python distribution with Sigstore - and upload them to GitHub Release + name: Sigstore and GitHub Release needs: - publish-to-pypi runs-on: ubuntu-latest diff --git a/README.md b/README.md index 56fb0d1..38109e2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# blivedm +# laplace-blivedm Fork of [blivedm](https://github.com/xfgryujk/blivedm) with additional events support diff --git a/scripts/build b/scripts/build new file mode 100755 index 0000000..5244cda --- /dev/null +++ b/scripts/build @@ -0,0 +1,12 @@ +#!/bin/sh -e + +if [ -d 'venv' ] ; then + PREFIX="venv/bin/" +else + PREFIX="" +fi + +set -x + +${PREFIX}python -m build +${PREFIX}twine check dist/* diff --git a/scripts/install b/scripts/install new file mode 100755 index 0000000..58b6324 --- /dev/null +++ b/scripts/install @@ -0,0 +1,19 @@ +#!/bin/sh -e + +# Use the Python executable provided from the `-p` option, or a default. +[ "$1" = "-p" ] && PYTHON=$2 || PYTHON="python3" + +REQUIREMENTS="requirements.txt" +VENV="venv" + +set -x + +if [ -z "$GITHUB_ACTIONS" ]; then + "$PYTHON" -m venv "$VENV" + PIP="$VENV/bin/pip" +else + PIP="pip" +fi + +"$PIP" install -U pip +"$PIP" install -r "$REQUIREMENTS"