| 1 |
name: Deploy and Release |
| 2 |
|
| 3 |
|
| 4 |
on: |
| 5 |
|
| 6 |
push: |
| 7 |
branches: |
| 8 |
- master |
| 9 |
paths: |
| 10 |
- dpath/version.py |
| 11 |
|
| 12 |
|
| 13 |
jobs: |
| 14 |
|
| 15 |
deploy: |
| 16 |
|
| 17 |
runs-on: ubuntu-latest |
| 18 |
|
| 19 |
|
| 20 |
steps: |
| 21 |
|
| 22 |
- uses: actions/checkout@v2 |
| 23 |
|
| 24 |
- name: Get Version |
| 25 |
id: get-version |
| 26 |
run: | |
| 27 |
python -c "from dpath.version import VERSION; print(f'::set-output name=version::v{VERSION}');" |
| 28 |
|
| 29 |
- name: Check Tag |
| 30 |
uses: mukunku/[email protected] |
| 31 |
id: check-tag |
| 32 |
with: |
| 33 |
tag: ${{ steps.get-version.outputs.version }} |
| 34 |
env: |
| 35 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 |
|
| 37 |
- name: Create Tag |
| 38 |
if: steps.check-tag.outputs.exists == 'false' |
| 39 |
uses: negz/create-tag@v1 |
| 40 |
with: |
| 41 |
version: ${{ steps.get-version.outputs.version }} |
| 42 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 43 |
|
| 44 |
- name: Generate Changelog |
| 45 |
id: generate-changelog |
| 46 |
uses: loopwerk/tag-changelog@v1 |
| 47 |
with: |
| 48 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 49 |
config_file: .github/tag-changelog-config.js |
| 50 |
|
| 51 |
- name: PyPI Deployment |
| 52 |
uses: casperdcl/deploy-pypi@v2 |
| 53 |
with: |
| 54 |
|
| 55 |
user: ${{ secrets.PYPI_USER }} |
| 56 |
|
| 57 |
password: ${{ secrets.PYPI_PASS }} |
| 58 |
|
| 59 |
build: clean sdist -d dist/ |
| 60 |
|
| 61 |
pip: true |
| 62 |
|
| 63 |
- name: Github Release |
| 64 |
uses: softprops/action-gh-release@v1 |
| 65 |
with: |
| 66 |
tag_name: ${{ steps.get-version.outputs.version }} |
| 67 |
body: ${{ steps.generate-changelog.outputs.changes }} |
| 68 |
files: dist/* |