-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (39 loc) · 1.24 KB
/
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
37
38
39
40
on:
workflow_dispatch:
inputs:
version:
required: true
jobs:
bump-version-and-publish:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v3
- name: Bump version
run: |
sed -i "/VERSION =/c\VERSION = '${{ github.event.inputs.version }}'" setup.py
git diff
- uses: EndBug/add-and-commit@v9
with:
add: setup.py
tag: -a "${{ github.event.inputs.version }}" -m "Version ${{ github.event.inputs.version }}"
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
- uses: actions/setup-python@v3
with:
python-version: '3.9'
- run: python --version
- run: python -m pip install -U pip
- run: python -m pip install -U build
- run: python -m build
- run: ls dist
- run: python -m pip install -U twine
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}