mirror of
https://github.com/QuasarApp/pe-parse.git
synced 2025-04-27 04:44:31 +00:00
CI: Automatic pepy releases to PyPI (#131)
* workflows/release: Add PyPI release config * util/release: Don't push to PyPI manually The CI will handle this for us from now on. * VERSION: 1.1.0.rc.1 * workflows/release: Try on this branch * workflows/release: Syntax * workflows/release: Disable on this branch * VERSION: 1.1.0.rc.2
This commit is contained in:
parent
8736072cc1
commit
4880b14a13
34
.github/workflows/release.yml
vendored
Normal file
34
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
name: release
|
||||
|
||||
jobs:
|
||||
pypi:
|
||||
name: upload release to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: create release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: ${{ contains(github.ref, 'pre') || contains(github.ref, 'rc') }}
|
||||
- name: sdist
|
||||
run: python3 setup.py sdist
|
||||
- name: publish
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_TOKEN }}
|
||||
|
@ -26,7 +26,7 @@ done
|
||||
|
||||
# Next, check the VERSION in version and make sure it doesn't already have a git tag.
|
||||
[[ -f ./VERSION ]] || die "Missing VERSION file; wrong directory?"
|
||||
version=$(<./VERSION)
|
||||
version=v$(<./VERSION)
|
||||
[[ -n $(git tag -l "${version}") ]] && die "git tag for ${version} already exists!"
|
||||
|
||||
# Next, craft a tag for the current HEAD. Push both the current commit and the tag.
|
||||
@ -34,10 +34,4 @@ git tag "${version}"
|
||||
git push
|
||||
git push origin "${version}"
|
||||
|
||||
# Finally, build pepy and publish it to PyPI.
|
||||
# Nuke the dist/ directory before, to avoid old sdists.
|
||||
rm -rf dist/
|
||||
python3 setup.py sdist
|
||||
twine upload dist/*
|
||||
|
||||
echo OK
|
||||
|
Loading…
x
Reference in New Issue
Block a user