-
Notifications
You must be signed in to change notification settings - Fork 39
47 lines (39 loc) · 1.27 KB
/
release.yml
File metadata and controls
47 lines (39 loc) · 1.27 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
# .github/workflows/release.yml
name: Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.release.target_commitish }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🐍 Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
architecture: x64
- name: 📦 Install Poetry
run: pip install poetry==1.3.1
- name: 🔧 Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: 🚀 Bump version, commit, and push
run: |
poetry version ${{ github.ref_name }}
git add pyproject.toml
git commit -m "chore(release): version ${{ github.ref_name }}"
git tag -f ${{ github.ref_name }} HEAD
git push origin ${{ github.event.release.target_commitish }}
git push -f origin refs/tags/${{ github.ref_name }}
- name: 📦 Build package
run: poetry build
- name: 🚀 Publish to PyPI
run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}