-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (50 loc) · 1.37 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build and Publish
on:
push:
branches:
- release
jobs:
release:
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.12'
cache: 'poetry'
- name: Upgrade pip
run: |
pip install pip
pip --version
- name: Install Poetry
run: |
pip install poetry
poetry --version
- name: Install dependencies
run: poetry install --no-interaction
- name: Build wheel
run: poetry build
- name: Run Tests
run: poetry run pytest
- name: Generate release tag
id: tag
run: echo "release_tag=$(git rev-parse HEAD | head -c 8)" >> $GITHUB_OUTPUT
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: dist/*.whl
draft: false
prerelease: false
- name: Remove other releases
uses: sgpublic/[email protected]
with:
release-drop: true
release-keep-count: 2
release-drop-tag: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}