Skip to content

Commit 2b7b7ed

Browse files
ci: fixing jf upload usage
1 parent 38686ca commit 2b7b7ed

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

.github/workflows/publish-to-jfrog.yml

+30-7
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,55 @@ jobs:
1717
permissions:
1818
id-token: write
1919
contents: read
20+
attestations: write
2021

2122
steps:
2223
- name: Set up Python 3.10
2324
uses: actions/setup-python@v5
2425
with:
2526
python-version: '3.10'
26-
- name: Install build
27+
- name: Install build basics
2728
run: |
28-
pip install build
29+
pip install build wheel-filename blob
2930
- name: Checkout code
3031
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
fetch-tags: true
3135
- name: build package
32-
run: python3 -m build .
36+
run: python3 -m build . --sdist --wheel
37+
- name: get back local build version
38+
id: get_pkg_version
39+
run: |
40+
from wheel_filename import parse_wheel_filename
41+
import glob
42+
import os
43+
from random import choices
44+
from string import ascii_letters
45+
46+
whl = str(glob.glob('dist/*.whl')[0]);
47+
pwf = parse_wheel_filename('dist/' + whl);
48+
with open(os.environ["GITHUB_OUTPUT"], "a") as gh_output:
49+
delimiter = "".join(choices(ascii_letters, k=16))
50+
gh_output.writelines([
51+
f"pkg_version<<{delimiter}\n",
52+
f"{pwf.version}\n",
53+
delimiter + "\n",
54+
])
55+
shell: python
3356
- name: Login to JFrog Ledger
3457
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
3558
- name: set jfrog Repo URL
3659
run: jf pip-config --repo-resolve=${{ secrets.JFROG_PYPI_REPO_URL }}
3760
- name: upload package
38-
run: jf rt u dist/ --build-name=dts-util-devel --build-number=1 --module=dts-utils
61+
run: jf rt u --build-name=dts-util-devel --build-number=1 --module=dts-utils 'dist/*.tar.gz' 'outpost-pypi-dev-green/outpost-pypi-dev-green/'
3962
- name: Attest
4063
id: attest
4164
uses: LedgerHQ/actions-security/actions/attest@actions/attest-1
4265
with:
43-
subject-path: 'dist/*'
44-
push-to-registry: true
66+
subject-path: 'dist/*.tar.gz'
67+
push-to-registry: false
4568
- name: test install from jfrog
4669
run: |
47-
jf pip install dts-utils
70+
jf pip install dts-utils==${{ steps.get_pkg_version.outputs.pkg_version }}
4871
pip show dts-utils

0 commit comments

Comments
 (0)