-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (52 loc) · 1.57 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
63
64
name: "Release and Publish"
on:
push:
tags:
- "v*.*.*"
jobs:
Build:
name: "Tagged Release"
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
- name: Set ENV
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install Poetry
run: |
pipx install poetry
poetry self add poetry-bumpversion
- name: Setup Python
uses: actions/setup-python@v4.5.0
with:
python-version: "3.11"
cache: 'poetry'
- name: Bump package version
run: poetry version $(echo "${{ env.RELEASE_VERSION }}" | sed 's/v//')
- name: Commit and push version bump
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -u
git commit -m "chore(release): ${{ env.RELEASE_VERSION }} release"
git push
- name: Install Dependencies
run: poetry install
- name: Build
run: poetry build
- name: Release
shell: bash
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_API_TOKEN
poetry publish
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
files: |
dist/*.whl