-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (62 loc) · 2.08 KB
/
publish-to-jfrog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# SPDX-FileCopyrightText: 2024 Ledger SAS
#
# SPDX-License-Identifier: Apache-2.0
name: Upload Python Package to jfrog
on:
release:
types: [released]
workflow_dispatch:
jobs:
deploy:
runs-on: outpost-os-shared-small
environment: ledger-publish
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install build basics
run: |
pip install build wheel-filename blob
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: build package
run: python3 -m build . --sdist --wheel
- name: get back local build version
id: get_pkg_version
run: |
from wheel_filename import parse_wheel_filename
import glob
sdist = glob.glob('dist/*.tar.gz');
pwf = parse_wheel_filename(sdist);
with open(os.environ["GITHUB_OUTPUT"], "a") as gh_output:
delimiter = "".join(choices(ascii_letters, k=16))
gh_output.writelines([
f"pkg_version<<{delimiter}\n",
f"{pwf.version}\n",
delimiter + "\n",
])
shell: python
- name: Login to JFrog Ledger
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
- name: set jfrog Repo URL
run: jf pip-config --repo-resolve=${{ secrets.JFROG_PYPI_REPO_URL }}
- name: upload package
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/'
- name: Attest
id: attest
uses: LedgerHQ/actions-security/actions/attest@actions/attest-1
with:
subject-path: 'dist/*.tar.gz'
push-to-registry: false
- name: test install from jfrog
run: |
jf pip install dts-utils~=${{ steps.get_pkg_version.outputs.pkg_version }}
pip show dts-utils