Skip to content

Commit

Permalink
Fix CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
ostefano committed Dec 16, 2024
1 parent a4a59a7 commit 41a84d1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/python-ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']

name: Python ${{ matrix.python-version }} Build
steps:
Expand All @@ -32,3 +32,24 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)

publish-to-test-pypi:
runs-on: ubuntu-latest
needs: test

permissions:
id-token: write

steps:
- name: Download dist files
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish to Test PyPI
if: ${{ github.event_name == 'push' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
repository-url: https://test.pypi.org/legacy/
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
from codecs import open
import os.path
import sys
import pkg_resources

from setuptools import find_packages, setup

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



try:
pkg_resources.get_distribution("stix2")
sys.exit(f"Error: 'stix2' is installed. Uninstall it before proceeding.")
except pkg_resources.DistributionNotFound:
pass


setup(
name='misp-lib-stix2',
version=get_version(),
Expand Down

0 comments on commit 41a84d1

Please sign in to comment.