-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.35 KB
/
publish.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
# This will run every time a tag is created.
# It calls our tests workflow via a `workflow_call`, and if tests pass
# then it triggers our upload to PyPI for a new release.
name: Publish to PyPI
on:
push:
tags:
permissions:
contents: read
jobs:
# calls our general CI workflow (tests, build docs, etc.)
tests:
uses: ./.github/workflows/CI.yaml
build-package:
name: "Build & verify 🐻 Lours package"
needs: [tests] # require tests to pass before deploy runs
runs-on: ubuntu-latest
steps:
- name: "Checkout repository 🛎"
uses: actions/checkout@v4
- name: Install poetry
uses: abatilo/actions-poetry@v3
- name: "Build and inspect package 📦"
uses: hynek/build-and-inspect-python-package@v2
id: baipp
release-pypi:
runs-on: ubuntu-latest
needs: [build-package]
environment: release
permissions:
id-token: write # needed for PyPI upload
steps:
- name: "Download 🐻 Lours built package 📦"
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: "Unzip artifact"
run: |
tar xvf dist/*.tar.gz --strip-components=1
- name: "Publish 🐻 Lours package to PyPI 🚀"
uses: pypa/gh-action-pypi-publish@release/v1
if: github.repository_owner == 'XXII-AI'