-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.24 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (47 loc) · 1.24 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
48
49
50
51
52
53
54
55
56
57
58
59
name: Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- name: Release Please
id: release
uses: googleapis/release-please-action@v4
with:
release-type: python
package-name: blackwall-llm-shield-python
publish:
needs: release
if: ${{ needs.release.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
environment:
name: pypi
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build tooling
run: python -m pip install --upgrade pip build twine
- name: Run tests
run: python -m unittest discover -s tests
- name: Build package
run: python -m build
- name: Validate package metadata
run: python -m twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/