Skip to content

Commit

Permalink
wip: publish test run
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldaviestelicent committed May 22, 2024
1 parent 409d0a3 commit 8fcf2b3
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 33 deletions.
51 changes: 19 additions & 32 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,28 @@
name: Release to PyPI

#on:
# push:
# branches:
# - "main"
# paths:
# - "CHANGELOG.md"
# workflow_dispatch:

on:
push:
branches:
branches-ignore:
- "main"
paths:
- "CHANGELOG.md"
workflow_dispatch:

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
prepare-release:
name: Build Release
uses: ./python-build-release.yml

publish-to-pypi:
name: Publish Python distribution to PyPI
needs:
- build
- prepare-release
runs-on: ubuntu-latest

environment:
Expand All @@ -56,5 +39,9 @@ jobs:
name: python-package-distributions
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Confirm All's OK
run: |
ls ./*
# - name: Publish distribution to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
45 changes: 45 additions & 0 deletions .github/workflows/python-build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Python Release

on:
workflow_dispatch:

jobs:
build:
name: Build Release Distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Cyclone DX Vulnerability Scan
uses: python-cyclone-dx.yml

- name: Download SBOM
uses: actions/download-artifact@v3
with:
name: cyclone-dx-sbom

- name: Place SBOM in pkg
run: |
mv ${{ github.run_number }}-cyclone-dx.json telicent_lib/sbom.json
- name: Build a binary wheel and a source tarball
run: python3 -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ include = ["telicent_lib*"]
namespaces = true

[tool.setuptools.package-data]
"telicent_lib" = ["cyclonedx.json"]
"telicent_lib" = ["sbom.json"]

[tool.mypy]
no_implicit_optional = false
Expand Down

0 comments on commit 8fcf2b3

Please # to comment.