Skip to content

Commit f7d97bc

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

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

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

+27-7
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,52 @@ 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+
43+
whl = str(glob.glob('dist/*.whl')[0]);
44+
pwf = parse_wheel_filename('dist/' + whl);
45+
with open(os.environ["GITHUB_OUTPUT"], "a") as gh_output:
46+
delimiter = "".join(choices(ascii_letters, k=16))
47+
gh_output.writelines([
48+
f"pkg_version<<{delimiter}\n",
49+
f"{pwf.version}\n",
50+
delimiter + "\n",
51+
])
52+
shell: python
3353
- name: Login to JFrog Ledger
3454
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
3555
- name: set jfrog Repo URL
3656
run: jf pip-config --repo-resolve=${{ secrets.JFROG_PYPI_REPO_URL }}
3757
- name: upload package
38-
run: jf rt u dist/ --build-name=dts-util-devel --build-number=1 --module=dts-utils
58+
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/'
3959
- name: Attest
4060
id: attest
4161
uses: LedgerHQ/actions-security/actions/attest@actions/attest-1
4262
with:
43-
subject-path: 'dist/*'
44-
push-to-registry: true
63+
subject-path: 'dist/*.tar.gz'
64+
push-to-registry: false
4565
- name: test install from jfrog
4666
run: |
47-
jf pip install dts-utils
67+
jf pip install dts-utils~=${{ steps.get_pkg_version.outputs.pkg_version }}
4868
pip show dts-utils

0 commit comments

Comments
 (0)