@@ -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
|
||||
@@ -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*
|
||||
+18
@@ -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
|
||||
Reference in New Issue
Block a user