From ebd583a822a3a6b9a0c9fd8c6cb76361a3a59901 Mon Sep 17 00:00:00 2001 From: Bryce Thorup Date: Thu, 14 May 2026 12:54:56 -0600 Subject: [PATCH] a --- action.sh | 37 ------------------------------------- action.yaml | 24 +++++++++++++++++++++++- install_pypi_config.sh | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+), 38 deletions(-) delete mode 100755 action.sh create mode 100755 install_pypi_config.sh diff --git a/action.sh b/action.sh deleted file mode 100755 index 84350dc..0000000 --- a/action.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -### INSTALL UV, PYTHON, AND DEPS ### - -wget -qO- https://astral.sh/uv/install.sh | sh -source "$HOME/.local/bin/env" -bash uv venv -source .venv/bin/activate -bash uv pip install build twine - -### CONFIGURE PYPI ### - -config_template=' -[distutils] -index-servers = repo - -[repo] -repository = {repository} -username = {username} -password = {password} -' - -# Replace placeholders with environment variables -config_output=$(echo "$config_template" | \ - sed -e "s/{repository}/$PYPI_REPO_DOMAIN/g" \ - -e "s/{username}/$PYPI_REPO_USER/g" \ - -e "s/{password}/$PYPI_REPO_PASS/g") - -echo "$config_output" > "$HOME/.pypirc" - -### BUILD PYPI PACKAGE ### - -python -m build - -### PUBLISH PYPI PACKAGE ### - -python3 -m twine upload --repository repo ./dist* \ No newline at end of file diff --git a/action.yaml b/action.yaml index 20849f2..9fca463 100644 --- a/action.yaml +++ b/action.yaml @@ -14,5 +14,27 @@ inputs: runs: using: "composite" steps: - - run: $GITHUB_ACTION_PATH/action.sh + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b + with: + version: "0.11.14" + + - name: Set up Python + run: uv python install + shell: bash + + - name: Install build and twine + run: uv pip install build twine + shell: bash + + - name: Install PyPI config + run: $GITHUB_ACTION_PATH/action.sh + shell: bash + + - name: Build project + run: python -m build + shell: bash + + - name: Publish package + run: python3 -m twine upload --repository repo ./dist/* shell: bash diff --git a/install_pypi_config.sh b/install_pypi_config.sh new file mode 100755 index 0000000..e20d6e4 --- /dev/null +++ b/install_pypi_config.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +config_template=' +[distutils] +index-servers = repo + +[repo] +repository = {repository} +username = {username} +password = {password} +' + +# Replace placeholders with environment variables +config_output=$(echo "$config_template" | \ + sed -e "s/{repository}/$PYPI_REPO_DOMAIN/g" \ + -e "s/{username}/$PYPI_REPO_USER/g" \ + -e "s/{password}/$PYPI_REPO_PASS/g") + +echo "$config_output" > "$HOME/.pypirc" \ No newline at end of file