Skip to content

Commit 421369e

Browse files
authored
Merge pull request #38 from j0057/update-release-instructions
README.md: Improve "how to make a release ?" instructions
2 parents 7bca7ed + f302e16 commit 421369e

File tree

2 files changed

+63
-15
lines changed

2 files changed

+63
-15
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Next Release
22
============
33

4+
Documentation
5+
-------------
6+
7+
* Improve README section [maintainers: how to make a release ?](./README.md#maintainers-how-to-make-a-release-)
8+
49
1.5.7
510
=====
611

README.md

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -344,66 +344,109 @@ that has already been intercepted and recorded.
344344

345345
1. Configure `~/.pypirc` as described [here](https://packaging.python.org/distributing/#uploading-your-project-to-pypi).
346346

347-
2. Make sure the cli and module work as expected
347+
2. Make sure the cli and module work as expected.
348348

349-
3. Review [CHANGES.md](https://github.com/j0057/github-release/blob/master/README.md), replace *Next Release* into *X.Y.Z*, commit and push. Consider using `[ci skip]` in commit message.
349+
3. Choose the next release version number:
350350

351-
4. Tag the release. Requires a GPG key with signatures. For version *X.Y.Z*:
351+
```bash
352+
release="X.Y.Z"
353+
```
354+
355+
4. Review [CHANGES.md](https://github.com/j0057/github-release/blob/master/README.md), replace *Next Release* into *X.Y.Z*, commit and push. Consider using `[ci skip]` in commit message:
356+
357+
```bash
358+
sed -i -e "s/Next Release/${release}/" CHANGES.md
359+
sed -i -e "s/============/=====/" CHANGES.md
360+
git add CHANGES.md
361+
git commit -m "CHANGES.md: Replace \"Next Release\" with \"${release}\"
362+
363+
[ci skip]
364+
"
365+
```
366+
367+
Review commit, then push:
368+
369+
```bash
370+
git push origin master
371+
```
372+
373+
5. Tag the release. Requires a GPG key with signatures:
374+
375+
```bash
376+
git tag -s -m "githubrelease ${release}" ${release} origin/master
377+
```
378+
379+
And push:
352380

353381
```bash
354-
git tag -s -m "githubrelease X.Y.Z" X.Y.Z origin/master
382+
git push origin ${release}
355383
```
356384

357-
5. Create the source tarball and binary wheels:
385+
6. Create the source tarball and binary wheels:
358386

359387
```bash
360388
rm -rf dist/
361389
python setup.py sdist bdist_wheel
362390
```
363391

364-
6. Upload the packages to the testing PyPI instance:
392+
7. Upload the packages to the testing PyPI instance:
365393

366394
```bash
367395
twine upload --sign -r pypitest dist/*
368396
```
369397

370-
7. Check the [PyPI testing package page](https://testpypi.python.org/pypi/githubrelease/).
398+
8. Check the [PyPI testing package page](https://testpypi.python.org/pypi/githubrelease/).
371399

372-
8. Upload the packages to the PyPI instance::
400+
9. Upload the packages to the PyPI instance::
373401

374402
```bash
375403
twine upload --sign dist/*
376404
```
377405

378-
9. Check the [PyPI package page](https://pypi.python.org/pypi/githubrelease/).
406+
10. Check the [PyPI package page](https://pypi.python.org/pypi/githubrelease/).
379407

380-
10. Create a virtual env, and make sure the package can be installed:
408+
11. Create a virtual env, and make sure the package can be installed:
381409

382410
```bash
383411
mkvirtualenv test-githubrelease-install
384412
pip install githubrelease
385413
```
386414

387-
11. Create github release and upload packages:
415+
12. Create github release and upload packages:
388416

389417
```bash
390418
export GITHUB_TOKEN=YOUR_TOKEN
391-
githubrelease release j0057/github-release create X.Y.Z --name X.Y.Z --publish ./dist/*
419+
githubrelease release j0057/github-release create ${release} --name ${release} --publish ./dist/*
392420
```
393421

394-
12. Update release notes by copying relevant content from CHANGES.md
422+
13. Update release notes by copying relevant content from CHANGES.md
395423

396424
```bash
397425
export EDITOR=vim
398-
githubrelease release j0057/github-release release-notes X.Y.Z
426+
githubrelease release j0057/github-release release-notes ${release}
399427
```
400428

401-
13. Cleanup
429+
14. Cleanup
402430

403431
```bash
432+
deactivate
404433
rmvirtualenv test-githubrelease-install
405434
```
406435

436+
And update ``CHANGES.md``:
437+
438+
```bash
439+
sed -i '1i Next Release\n============\n' CHANGES.md
440+
git add CHANGES.md
441+
git commit -m "Begin ${release} development
442+
443+
* CHANGES.md: Add \"Next Release\" section
444+
445+
[ci skip]
446+
"
447+
git push origin master
448+
```
449+
407450
# faq
408451

409452
* Why do I get a ``requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url https://api.github.com/repos/...`` ?

0 commit comments

Comments
 (0)