Skip to content

Commit 1f3777d

Browse files
authored
chore(release): update SBOM to use latest Anchore action (#7)
1 parent 84147f8 commit 1f3777d

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

.github/workflows/release.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: Release Workflow
22

33
on:
4-
workflow_run:
5-
workflows:
6-
- CI
7-
types:
8-
- completed
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
98

109
permissions:
1110
contents: write # Required for creating releases
@@ -21,7 +20,7 @@ concurrency:
2120

2221
jobs:
2322
semantic-release:
24-
if: ${{ github.ref == 'refs/heads/main' && github.event.workflow_run.conclusion == 'success' }}
23+
if: ${{ github.ref == 'refs/heads/main' }}
2524
runs-on: ubuntu-latest
2625
steps:
2726
- uses: actions/checkout@v4
@@ -51,12 +50,36 @@ jobs:
5150
permissions:
5251
contents: write
5352
actions: read
53+
security-events: write
5454
steps:
5555
- uses: actions/checkout@v4
5656
- name: Generate SBOM
57-
uses: anchore/sbom-action@0.20.0
57+
uses: anchore/sbom-action@v0
5858
with:
5959
path: . # Generate SBOM for the entire repository
6060
artifact-name: sbom.spdx.json # Name of the generated SBOM file
6161
format: spdx-json # Use SPDX format for SBOM
6262
dependency-snapshot: true # Include dependency snapshot
63+
64+
publish-testpypi:
65+
needs: semantic-release
66+
if: ${{ github.ref == 'refs/heads/main' }}
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
- name: Set up Python
71+
uses: actions/setup-python@v5
72+
with:
73+
python-version: 3.11
74+
- name: Install dependencies
75+
run: |
76+
pip install poetry
77+
poetry install --with dev
78+
- name: Build package
79+
run: |
80+
poetry build
81+
- name: Publish to TestPyPI
82+
uses: pypa/gh-action-pypi-publish@release/v1
83+
with:
84+
password: ${{ secrets.TESTPYPI_API_TOKEN }}
85+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)