Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split CI workflows into 'test' and 'deploy' #367

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: deploy

on:
push:
tags:
- "*"

permissions: {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from pytest


jobs:
deploy:
if: github.repository == 'pytest-dev/pytest'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build

- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
33 changes: 2 additions & 31 deletions .github/workflows/main.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name: main
name: test

on:
push:
branches:
- main
tags:
- "*"

pull_request:
branches:
- main

jobs:
build:
test:
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -113,30 +111,3 @@ jobs:
env:
CODECOV_NAME: ${{ matrix.name }}
run: bash scripts/upload-coverage.sh -F GHA,${{ runner.os }}

deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pluggy'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools setuptools_scm

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_token }}
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Running this directly gets us::
.. |versions| image:: https://img.shields.io/pypi/pyversions/pluggy.svg
:target: https://pypi.org/pypi/pluggy

.. |github-actions| image:: https://github.com/pytest-dev/pluggy/workflows/main/badge.svg
.. |github-actions| image:: https://github.com/pytest-dev/pluggy/workflows/test/badge.svg
:target: https://github.com/pytest-dev/pluggy/actions

.. |conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/pluggy.svg
Expand Down