Skip to content

Commit

Permalink
Use github action to push a release to PyPI (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamielennox authored Apr 27, 2021
1 parent 402fd62 commit b80b2c3
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 28 deletions.
28 changes: 0 additions & 28 deletions .circleci/config.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Create Release

on:
push:
tags:
- 'v*'

jobs:
build:
name: Build Release Objects
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel reno
- name: Build and publish
run: |
python setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist
if-no-files-found: error

pypi:
name: Create Github Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Get artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# name: ${{ github.ref }}
# prerelease: true
# draft: true
files: |
dist/*
release:
name: Push to PyPI
runs-on: ubuntu-latest
needs: build
steps:
- name: Get artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
packages_dir: dist/
password: ${{ secrets.PYPI_TOKEN }}
# password: ${{ secrets.TEST_PYPI_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
Empty file removed requests_mock/py.typed
Empty file.

0 comments on commit b80b2c3

Please sign in to comment.