-
Notifications
You must be signed in to change notification settings - Fork 28
53 lines (44 loc) · 1.34 KB
/
test-pypi.yml
File metadata and controls
53 lines (44 loc) · 1.34 KB
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
46
47
48
49
50
51
52
53
name: Bump pre-release and publish to Test PyPI on develop update
on:
push:
branches:
- develop
paths-ignore:
- 'pyproject.toml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install poetry
run: pip install poetry
- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@github.com"
- name: Configure Test PyPI and Token
run: |
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Bump package version and push change
run: |
poetry version prerelease
NEW_VERSION=$(poetry version --short)
git add pyproject.toml
git commit -m "Bump version to $NEW_VERSION [skip ci]"
git push origin develop
- name: Build and publish to Test PyPI
run: |
poetry build
poetry publish --repository test-pypi
- name: Sync with GitHub release tag
run: |
NEW_VERSION=$(poetry version --short)
git tag $NEW_VERSION
git push origin $NEW_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}