Run package workflow on branch pushes
This commit is contained in:
@@ -2,12 +2,12 @@ name: Publish Package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
branches:
|
||||
- "**"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -32,6 +32,39 @@ jobs:
|
||||
run: |
|
||||
python -m twine check dist/*
|
||||
|
||||
- name: Upload distribution artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist/*
|
||||
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: ${{ startsWith(github.ref, 'refs/heads/8.0.') }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install publish tools
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install build twine
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
python -m build
|
||||
|
||||
- name: Check package
|
||||
run: |
|
||||
python -m twine check dist/*
|
||||
|
||||
- name: Publish to Gitea PyPI registry
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.GITEA_PACKAGE_USER }}
|
||||
|
||||
+6
-4
@@ -1,8 +1,10 @@
|
||||
Publishing
|
||||
==========
|
||||
|
||||
Packages are published to the Gitea PyPI-compatible package registry when a
|
||||
version tag is pushed.
|
||||
Every pushed commit builds and validates the package.
|
||||
|
||||
Packages are published to the Gitea PyPI-compatible package registry when the
|
||||
push is made to a version branch named like ``8.0.0``, ``8.0.1``, etc.
|
||||
|
||||
Required repository secrets:
|
||||
|
||||
@@ -13,8 +15,8 @@ Publish a release:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
git tag v8.0.0
|
||||
git push origin v8.0.0
|
||||
git switch -c 8.0.0
|
||||
git push origin 8.0.0
|
||||
|
||||
Install from Gitea:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user