-
Notifications
You must be signed in to change notification settings - Fork 7
41 lines (39 loc) · 1.3 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
name: Release and publish
on: [workflow_dispatch]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/get-release-version
id: release_version
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: 3.11
cache: poetry
- name: Install dependencies
run: poetry install --no-interaction --no-root --with dev
- name: Build
run: poetry build
- name: Tag release
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag ${{ steps.release_version.outputs.version }}
git push origin ${{ steps.release_version.outputs.version }}
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: dist/*
tag_name: ${{ steps.release_version.outputs.version}}
generate_release_notes: true
name: ${{ steps.release_version.outputs.version}}
- name: Publish
run: poetry run twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}