Skip to content

reverted: pypi-publish and test-pypi-publish from workflows/python-pa… #28

reverted: pypi-publish and test-pypi-publish from workflows/python-pa…

reverted: pypi-publish and test-pypi-publish from workflows/python-pa… #28

Workflow file for this run

# This workflow will do Continous Integration (CI) and Continous Deployment (CD).
# It will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see:
# https://py-pkgs.org/08-ci-cd
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: ci-cd
# Controls when the workflow will run
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run
# sequentially or in parallel
jobs:
ci:
# Set up operating system
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.12"] #, "3.11", "3.10", "3.9"]
os: [ubuntu-latest] #, macOS-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pdm install -dG test
- name: Run Tests
run: |
pdm run pytest
release1:
concurrency: release1
permissions:
contents: write
# Only run this job if the "ci" job passes
needs: ci
# Only run this job if new work is pushed to the "master" branch
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# Set up operating system
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.release.outputs.tag }}
released: ${{ steps.release.outputs.released }}
# Define job steps
steps:
- name: Set up Python 3.12
uses: actions/setup-python@main
with:
python-version: 3.12
- name: Check-out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
submodules: recursive
- name: Use Python Semantic Release to prepare release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/publish-action@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Store the distribution packages
uses: actions/upload-artifact@v4
if: steps.release.outputs.released == 'true'
with:
name: python-package-distributions
path: dist/