-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.4 KB
/
publish.yaml
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
37
38
39
40
41
42
43
44
45
name: Bump version
on:
pull_request:
types:
- closed
jobs:
bump_version_and_publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
run: pipx install poetry || pip install poetry
- name: Install dependencies
run: |
poetry lock --no-update
poetry install --with dev
- name: Bump version and push tag
if: success() # Only continue if all was successful till now
uses: anothrNick/github-tag-action@1.67.0
env:
GITHUB_TOKEN: ${{secrets.LIB_ML_PAT_CONTENT_ACCESS}}
DEFAULT_BUMP: patch
TAG_CONTEXT: branch
WITH_V: false
PRERELEASE: false
- name: Update files with new version
if: success() # Only continue if tagging was successful
run: poetry run bump-my-version replace --config-file pyproject.toml --new-version $(git describe --tags --abbrev=0)
- name: Build and publish to PyPI
if: success() # Only continue if version in files was updated
run: |
poetry publish --build -u __token__ -p ${{ secrets.PYPI_API_KEY }}