X Tutup
Skip to content

Merge branch 'release' of https://github.com/UniversalPython/Universa… #31

Merge branch 'release' of https://github.com/UniversalPython/Universa…

Merge branch 'release' of https://github.com/UniversalPython/Universa… #31

name: Release (release → PyPI)
on:
push:
branches:
- release
permissions:
contents: write
id-token: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
environment:
name: pypi-universalpython
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine python-semantic-release
pip install -r utils/requirements.txt
- name: Create stable release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
semantic-release version --commit --tag --push
echo "released=$?" >> $GITHUB_OUTPUT
- name: Build package
if: steps.release.outputs.released == '0'
run: bash utils/build_package.sh
# - name: Publish to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
# packages-dir: dist/
- name: Publish to PyPI
if: steps.release.outputs.released == '0'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
skip-existing: true
X Tutup