-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (53 loc) · 1.54 KB
/
release.yml
File metadata and controls
65 lines (53 loc) · 1.54 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
54
55
56
57
58
59
60
61
62
63
64
65
name: Release Stage Build
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: sudo apt-get install make
- name: Create virtual environment
run: make venv
- name: Build package
run: |
set -x
source venv/bin/activate
rm -rf build dist *.egg-info
make build ENV=stage
- name: Extract Version from version file
id: get_version
run: |
VERSION=$(grep -Po '^__version__\s*=\s*"\K[^"]+' extend/__version__.py)
echo "Version extracted: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
- name: Install Twine
run: |
source venv/bin/activate
pip install twine
- name: Upload to PyPI
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
source venv/bin/activate
twine upload dist/* -u __token__ -p $PYPI_API_TOKEN