|
5 | 5 | name: Upload Python Package to jfrog
|
6 | 6 |
|
7 | 7 | on:
|
8 |
| - release: |
9 |
| - types: [released] |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
10 | 11 | workflow_dispatch:
|
11 | 12 |
|
12 | 13 | jobs:
|
13 |
| - deploy: |
14 |
| - runs-on: outpost-os-shared-small |
15 |
| - environment: ledger-publish |
16 |
| - |
| 14 | + pubhlish: |
17 | 15 | permissions:
|
18 | 16 | id-token: write
|
19 | 17 | contents: read
|
20 | 18 | attestations: write
|
21 |
| - |
22 |
| - steps: |
23 |
| - - name: Set up Python 3.10 |
24 |
| - uses: actions/setup-python@v5 |
25 |
| - with: |
26 |
| - python-version: '3.10' |
27 |
| - - name: Install build basics |
28 |
| - run: | |
29 |
| - pip install build wheel-filename blob |
30 |
| - - name: Checkout code |
31 |
| - uses: actions/checkout@v4 |
32 |
| - with: |
33 |
| - fetch-depth: 0 |
34 |
| - fetch-tags: true |
35 |
| - - name: build package |
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 |
56 |
| - - name: Login to JFrog Ledger |
57 |
| - uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1 |
58 |
| - - name: upload package |
59 |
| - 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/' |
60 |
| - - name: Attest |
61 |
| - id: attest |
62 |
| - uses: LedgerHQ/actions-security/actions/attest@actions/attest-1 |
63 |
| - with: |
64 |
| - subject-path: 'dist/*.tar.gz' |
65 |
| - push-to-registry: false |
66 |
| - - name: set jfrog Repo URL |
67 |
| - run: jf pipc --global --repo-resolve=outpost-pypi-virtual-green |
68 |
| - - name: test install from jfrog |
69 |
| - run: | |
70 |
| - jf pip install dts-utils==${{ steps.get_pkg_version.outputs.pkg_version }} |
71 |
| - pip show dts-utils |
| 19 | + uses: outpost-os/pipeline-python/.github/workflows/publish.yml@main |
| 20 | + with: |
| 21 | + environment: ledger-publish |
| 22 | + runner: outpost-os-shared-small |
| 23 | + python-version: '3.10' |
| 24 | + build-name: dts-utils-dev |
| 25 | + module-name: dts-utils |
| 26 | + repo-name: outpost-pypi-dev-green |
| 27 | + virtual-repo-name: outpost-pypi-virtual-green |
0 commit comments