-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.45 KB
/
release.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
41
42
43
44
45
46
47
48
name: Publish Python Package to PyPI
on:
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Configure user info
run: |
git config --local user.name "Asger Jon Vistisen"
git config --local user.email "asgerjon2@gmail.com"
- name: Install dependencies
run: pip install build twine bump2version
- name: Bump Version and Tag
id: version
run: |
bump2version patch --commit --tag
echo "::set-output name=tag::$(git describe --tags --abbrev=0)"
- name: Push Changes
run: |
git push && git push --tags
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
- name: Create GitHub Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required
with:
tag_name: ${{ steps.version.outputs.tag }}
release_name: Release ${{ steps.version.outputs.tag }}
body: |
Early version, work in progress
draft: false
prerelease: false