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

Commit 2394b44

Browse files
committed
Deploy to TestPyPI on merges to master, to PyPI for releases
1 parent d907d3b commit 2394b44

2 files changed

Lines changed: 67 additions & 0 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/

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)

0 commit comments

Comments
 (0)