commit fa55659004912184017e63f7c7671b1f9c59353a Author: Bryce Thorup Date: Thu May 14 10:55:18 2026 -0600 init version diff --git a/.gitea/workflows/push_to_main.yaml b/.gitea/workflows/push_to_main.yaml new file mode 100644 index 0000000..d4b219c --- /dev/null +++ b/.gitea/workflows/push_to_main.yaml @@ -0,0 +1,16 @@ +name: Push to main + +on: + push: + branches: [main] + +jobs: + Reset-Version-Tag: + runs-on: debian-bullseye + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: git tag -d v1 || true + - run: git push --delete origin v1 || true + - run: git tag v1 + - run: git push --tags diff --git a/action.sh b/action.sh new file mode 100644 index 0000000..6f67250 --- /dev/null +++ b/action.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +### INSTALL UV, PYTHON, AND DEPS ### + +wget -qO- https://astral.sh/uv/install.sh | sh +uv venv +source .venv/bin/activate +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 new file mode 100644 index 0000000..20849f2 --- /dev/null +++ b/action.yaml @@ -0,0 +1,18 @@ +name: pub-publish +description: "publishes latest version tag to a pypi repository" +author: "Bryce Thorup" +inputs: + pypi_repo_user: + description: Username used for authenticating with pypi repo + required: true + pypi_repo_pass: + description: Password used for authenticating with pypi repo + required: true + pub_repo_domain: + description: Domain for pypi repo + required: true +runs: + using: "composite" + steps: + - run: $GITHUB_ACTION_PATH/action.sh + shell: bash