-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.96 KB
/
release.yaml
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
66
67
68
69
70
71
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
concurrency: release
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.2
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Dependencies
run: |
poetry config virtualenvs.create false
poetry install --no-interaction --with dev
pip install 'python-semantic-release[build,dev,docs,mypy,test]'
pip install --no-deps structlog gitpython gitdb click tomlkit dotty_dict packaging requests semver rich wheel smmap typing-extensions urllib3 certifi idna charset-normalizer
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the new version
VERSION=$(semantic-release version --patch --print)
echo "New version: $VERSION"
# Update Poetry version
poetry version $VERSION
# Build the package
poetry build
# Commit the version changes
git add pyproject.toml
git commit -m "chore(release): bumping version to v${VERSION}"
git push
# Create GitHub release
gh release create "v${VERSION}" \
--title "Release v${VERSION}" \
--notes "Release v${VERSION}" \
dist/* \
--draft=false \
--prerelease=false