test what happens

This commit is contained in:
Schmieder, Jacob
2024-05-15 08:14:39 +00:00
parent 267baa139d
commit fa937c2ed1
+14 -66
View File
@@ -1,83 +1,31 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
# on:
# workflow_dispatch:
# inputs:
# branch_name:
# description: 'Branch to build from (default is main)'
# required: false
# default: 'main'
# workflow_run:
# workflows: ["Run Tests"]
# types:
# - completed
# branches: [main, develop] # This ensures it only triggers for these branches
on: on:
push: push:
branches: branches:
- develop - pyproject.toml # test branch for testing the workflow
tags:
- v* # Push tags to trigger the workflow
workflow_dispatch: workflow_dispatch:
inputs: inputs:
branch_name: test:
description: 'Branch to build from (default is main)' description: "Push to TestPyPI not PyPI"
required: false default: true
default: 'main' type: boolean
env:
TestPyPI_URL: https://test.pypi.org/p/scraibe
PyPI_URL: https://pypi.org/p/scraibe
PyPI_DEV_URL: https://pypi.org/p/scraibe-nightly
ISRELEASED: true
jobs: jobs:
Build-and-publish-to-Test-PyPI:
build: if: ${{ !(startsWith(github.ref, 'refs/tags')) || (inputs.test == true) }}
name: Build distribution 📦 uses: JRubics/poetry-publish@v1.16
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with: with:
python-version: "3.x" plugins: "poetry-dynamic-versioning"
- name: Install dependencies repository_name: "testpypi"
run: | repository_url: "https://test.pypi.org/legacy/"
python3 -m pip install --upgrade pip
pip install setuptools wheel
- name: Build source distribution
run: |
python3 setup.py sdist
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs: build
runs-on: ubuntu-latest
environment:
name: testpypi
url: env.TestPyPI_URL
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
test-install: test-install:
name: Test Installation from TestPyPI name: Test Installation from TestPyPI
needs: publish-to-testpypi needs: Build-and-publish-to-Test-PyPI
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Python - name: Set up Python