Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 3f58381

Browse files
authored
Merge pull request #428 from hugovk/autodeploy
Deploy to TestPyPI on merges to master, to PyPI for releases
2 parents 8327fed + 9ed0d04 commit 3f58381

6 files changed

Lines changed: 82 additions & 10 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
release:
8+
types:
9+
- published
10+
11+
jobs:
12+
build:
13+
if: github.repository == 'python-twitter-tools/twitter'
14+
runs-on: ubuntu-20.04
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Cache
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.cache/pip
25+
key: deploy-${{ hashFiles('**/setup.py') }}
26+
restore-keys: |
27+
deploy-
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: 3.9
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install -U pip
37+
python -m pip install -U setuptools twine wheel
38+
39+
- name: Build package
40+
run: |
41+
python setup.py --version
42+
python setup.py sdist --format=gztar bdist_wheel
43+
twine check dist/*
44+
45+
- name: Publish package to PyPI
46+
if: github.event.action == 'published'
47+
uses: pypa/gh-action-pypi-publish@master
48+
with:
49+
user: __token__
50+
password: ${{ secrets.pypi_password }}
51+
52+
- name: Publish package to TestPyPI
53+
uses: pypa/gh-action-pypi-publish@master
54+
with:
55+
user: __token__
56+
password: ${{ secrets.test_pypi_password }}
57+
repository_url: https://test.pypi.org/legacy/

MANIFEST.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
include AUTHORS
2-
include LICENSE
3-
include README
1+
prune .github
2+
prune tests
3+
prune utils
4+
exclude .coveragerc
5+
exclude .gitignore
6+
exclude README.md

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Python Twitter Tools
22
====================
33

4-
[![Tests](https://github.com/sixohsix/twitter/workflows/Tests/badge.svg)](https://github.com/sixohsix/twitter/actions)
5-
[![Coverage Status](https://coveralls.io/repos/github/sixohsix/twitter/badge.svg?branch=master)](https://coveralls.io/github/sixohsix/twitter?branch=master)
4+
[![Tests](https://github.com/python-twitter-tools/twitter/workflows/Tests/badge.svg)](https://github.com/python-twitter-tools/twitter/actions)
5+
[![Coverage Status](https://coveralls.io/repos/github/python-twitter-tools/twitter/badge.svg?branch=master)](https://coveralls.io/github/python-twitter-tools/twitter?branch=master)
66

77
The Minimalist Twitter API for Python is a Python API for Twitter,
88
everyone's favorite Web 2.0 Facebook-style status updater for people

RELEASING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Release Checklist
2+
3+
- [ ] Get master to the appropriate code release state.
4+
5+
- [ ] Publish release with new tag like `twitter-x.y.z`:
6+
https://github.com/python-twitter-tools/twitter/releases/new
7+
8+
- [ ] Check the tagged
9+
[GitHub Actions build](https://github.com/python-twitter-tools/twitter/actions?query=workflow%3ADeploy)
10+
has deployed to [PyPI](https://pypi.org/project/twitter/#history)

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
[egg_info]
2-
#tag_build = dev
3-
tag_svn_revision = false
41
[wheel]
52
universal = 1

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
with open("README") as f:
44
long_description = f.read()
55

6-
version = '1.18.0'
6+
7+
def local_scheme(version):
8+
"""Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2)
9+
to be able to upload to Test PyPI"""
10+
return ""
711

812
setup(name='twitter',
9-
version=version,
1013
description="An API and command-line toolset for Twitter (twitter.com)",
1114
long_description=long_description,
1215
long_description_content_type="text/markdown",
@@ -40,6 +43,8 @@
4043
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
4144
include_package_data=True,
4245
zip_safe=True,
46+
use_scm_version={"local_scheme": local_scheme},
47+
setup_requires=["setuptools_scm"],
4348
entry_points="""
4449
# -*- Entry points: -*-
4550
[console_scripts]

0 commit comments

Comments
 (0)