-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.05 KB
/
python-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Python package
on:
push:
branches:
- main
# tags:
# - "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pip install poetry
poetry config virtualenvs.create false
- name: Commit Tag
run: |
poetry version patch
tag=$(poetry version | grep -Eo "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag "v${tag}"
git add .
git commit -m "Bump version to v${tag}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Build and publish to pypi
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build