-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (47 loc) · 1.65 KB
/
build-and-publish.yaml
File metadata and controls
53 lines (47 loc) · 1.65 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
name: Build and Publish PyPi Packages
run-name: ${{ format('Release {0}', inputs.release_type)}} Package by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: The type of release
options:
- Major
- Minor
- Patch
publish_vulnerabilities:
type: string
default: "true"
vulnerability_failure_severity:
description: The severity to fail the workflow if such vulnerability is detected. DO NOT override it unless a Jira ticket is raised. Must be one of ['CRITICAL', 'CRITICAL,HIGH' or 'CRITICAL,HIGH,MEDIUM'] (without space in between).
type: string
default: 'CRITICAL,HIGH'
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10","3.11","3.12","3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Run unit tests
run: |
python -m unittest tests/*.py
build-and-pubish:
name: Build and publish Python packages to PyPi
needs: unit-tests
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-publish-to-pypi-versioned.yaml@v3
with:
release_type: ${{ inputs.release_type }}
publish_vulnerabilities: ${{ inputs.publish_vulnerabilities }}
vulnerability_failure_severity: ${{ inputs.vulnerability_failure_severity }}
secrets: inherit