mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-05-13 12:16:42 +00:00
feat: Restore GitHub Actions workflow for publishing Python package
This commit is contained in:
parent
f47cda9378
commit
edb8dfeb4b
1 changed files with 0 additions and 0 deletions
54
.github/workflows/upload.yml
vendored
Normal file
54
.github/workflows/upload.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
name: Publish Python Package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- production
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: bump-version
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip publish]') }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Pull latest changes
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip publish]') }}
|
||||
run: git pull origin production --tags --force
|
||||
|
||||
- name: Set up Python
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip publish]') }}
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install dependencies
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip publish]') }}
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build wheel
|
||||
|
||||
- name: Build package
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip publish]') }}
|
||||
run: python -m build
|
||||
|
||||
- name: Inspect METADATA (for debug)
|
||||
run: |
|
||||
unzip dist/*.whl -d temp/
|
||||
cat temp/*.dist-info/METADATA
|
||||
|
||||
- name: Publish package
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip publish]') }}
|
||||
uses: pypa/gh-action-pypi-publish@v1.12.4
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue