-
Notifications
You must be signed in to change notification settings - Fork 8
31 lines (29 loc) · 1.12 KB
/
pypi.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
---
name: PyPI upload
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: |
echo "##[set-output name=name;]$(echo ${GITHUB_REPOSITORY#*/})"
echo "##[set-output name=ver;]$(echo ${GITHUB_REF#refs/*/})"
echo "##[set-output name=minor_ver;]$(TMP_VAR=${GITHUB_REF#refs/*/}; echo ${TMP_VAR%.*})"
echo "##[set-output name=major_ver;]$(TMP_VAR=${GITHUB_REF#refs/*/}; echo ${TMP_VAR%.*.*})"
echo "##[set-output name=sha;]$(git rev-parse --short "$GITHUB_SHA")"
id: extract_name_and_version
- run: sed -i 's/0.1.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' pyproject.toml
- run: sed -i 's/0.1.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' makeqr/version.py
- run: python -m pip install poetry~=1.8.0
- run: poetry build
- run: poetry config http-basic.pypi __token__ ${{ secrets.PYPI_PASS }}
- run: poetry publish