@@ -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*
|
|
||||||
+23
-1
@@ -14,5 +14,27 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
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
|
shell: bash
|
||||||
|
|||||||
Executable
+19
@@ -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"
|
||||||
Reference in New Issue
Block a user