Skip to content

Commit b3c5586

Browse files
committed
Fix CI/CD
1 parent a4a59a7 commit b3c5586

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.github/workflows/python-ci-tests.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ name: cti-python-stix2 test harness
44
on: [push, pull_request]
55

66
jobs:
7-
build:
7+
test:
88

99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
12+
python-version: ['3.9', '3.10', '3.11', '3.12']
1313

1414
name: Python ${{ matrix.python-version }} Build
1515
steps:
@@ -32,3 +32,24 @@ jobs:
3232
token: ${{ secrets.CODECOV_TOKEN }}
3333
fail_ci_if_error: false # optional (default = false)
3434
verbose: true # optional (default = false)
35+
36+
publish-to-test-pypi:
37+
runs-on: ubuntu-latest
38+
needs: test
39+
40+
permissions:
41+
id-token: write
42+
43+
steps:
44+
- name: Download dist files
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
50+
- name: Publish to Test PyPI
51+
if: ${{ github.event_name == 'push' }}
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
with:
54+
skip-existing: true
55+
repository-url: https://test.pypi.org/legacy/

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env python
22
from codecs import open
33
import os.path
4+
import sys
5+
import pkg_resources
46

57
from setuptools import find_packages, setup
68

@@ -22,6 +24,14 @@ def get_long_description():
2224
return f.read()
2325

2426

27+
28+
try:
29+
pkg_resources.get_distribution("stix2")
30+
sys.exit(f"Error: 'stix2' is installed. Uninstall it before proceeding.")
31+
except pkg_resources.DistributionNotFound:
32+
pass
33+
34+
2535
setup(
2636
name='misp-lib-stix2',
2737
version=get_version(),

0 commit comments

Comments
 (0)