-
Notifications
You must be signed in to change notification settings - Fork 116
52 lines (48 loc) · 1.46 KB
/
pypi_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
---
name: libs/infinity_emb - Release Publish to pypi
on:
release:
types: [published]
env:
POETRY_VERSION: "1.7.1"
WORKDIR: "libs/infinity_emb"
jobs:
publish-to-pypi:
defaults:
run:
working-directory: ${{ env.WORKDIR }}
runs-on: ubuntu-latest
environment:
name: publish
permissions:
# This permission is used for trusted publishing:
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
#
# Trusted publishing has to also be configured on PyPI for each package:
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python + Poetry ${{ env.POETRY_VERSION }}
uses: "./.github/actions/poetry_setup"
with:
python-version: "3.10"
poetry-version: ${{ env.POETRY_VERSION }}
working-directory: ${{ env.WORKDIR }}
cache-key: release
- name: Copy readme
id: readme-copy
run: |
cp ../../README.md .
- name: Build project for distribution
run: poetry build
- name: Check Version
id: check-version
run: |
echo version=$(poetry version --short) >> $GITHUB_OUTPUT
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ env.WORKDIR }}/dist/
verbose: true
print-hash: true