Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e0ab016

Browse files
committedAug 9, 2024
Added python-get-version
1 parent 842be1c commit e0ab016

File tree

3 files changed

+65
-36
lines changed

3 files changed

+65
-36
lines changed
 

‎.github/workflows/compound-python-dev.yml

+29-36
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ on:
3232
# description: "Generated version of the image"
3333
# value: ${{ jobs.prebuild-job.outputs.version }}
3434
secrets:
35-
pypi-user:
36-
required: true
37-
description: 'TODO'
35+
# pypi-user:
36+
# required: true
37+
# description: 'TODO'
3838
pypi-password:
3939
required: true
4040
description: 'TODO'
@@ -45,49 +45,42 @@ jobs:
4545
name: Prebuild Job
4646
runs-on: ${{ inputs.runsOn }}
4747
steps:
48-
- name: Checkout
49-
uses: actions/checkout@v4
5048
- uses: th2-net/.github/.github/workflows/python-get-version.yml@python-workflow # FIXME: change to main
5149
id: get-version
52-
with: # TODO
50+
with:
5351
runsOn: ${{ inputs.runsOn }}
54-
- name: Build custom package version
52+
- name: Build custom package_version
5553
id: release-ver
5654
run: echo ::set-output name=custom-version::"${{ steps.get-version.outputs.version }}.dev${{ github.run_id }}"
57-
- name: Show package version
55+
- name: Show package_version
5856
run: echo ${{ steps.release-ver.outputs.custom-version }}
5957
outputs:
6058
version: ${{ steps.get-version.outputs.version }}
6159
custom-version: ${{ steps.release-ver.outputs.custom-version }}
6260

63-
matrix-test:
64-
name: Matrix test Job
65-
uses: th2-net/.github/.github/workflows/compound-python-matrix-test.yml@python-workflow # FIXME: change to main
66-
with: # TODO:
67-
runsOn: ${{ inputs.runsOn }}
61+
# matrix-test:
62+
# name: Matrix test Job
63+
# uses: th2-net/.github/.github/workflows/compound-python-matrix-test.yml@python-workflow # FIXME: change to main
64+
# with: # TODO:
65+
# runsOn: ${{ inputs.runsOn }}
6866

69-
vulnarbility-scan:
70-
if: inputs.scanner-enabled
71-
uses: th2-net/.github/.github/workflows/python-scan.yml@python-workflow # FIXME: change to main
72-
# with: TODO
73-
# secrets: TODO
74-
75-
license-check:
76-
if: inputs.scanner-enabled
77-
uses: th2-net/.github/.github/workflows/license_check.yml@python-workflow # FIXME: change to main
78-
needs: [prebuild-job]
79-
with:
80-
version: ${{ needs.prebuild-job.outputs.custom-version }}
67+
# vulnarbility-scan:
68+
# if: inputs.scanner-enabled
69+
# uses: th2-net/.github/.github/workflows/python-scan.yml@python-workflow # FIXME: change to main
70+
# # with: TODO
71+
# # secrets: TODO
8172

82-
set-version:
83-
name: Set custom version
84-
if: inputs.strict-scanner && success() || !inputs.strict-scanner
85-
needs: [prebuild-job]
86-
uses: th2-net/.github/.github/workflows/python-set-version.yml@python-workflow # FIXME: change to main
87-
with:
88-
version: ${{ needs.prebuild-job.outputs.custom-version }}
73+
# license-check:
74+
# if: inputs.scanner-enabled
75+
# uses: th2-net/.github/.github/workflows/license_check.yml@python-workflow # FIXME: change to main
76+
# needs: [prebuild-job]
77+
# with:
78+
# version: ${{ needs.prebuild-job.outputs.custom-version }}
8979

90-
pypi-publish:
91-
name: Publish to PyPi
92-
needs: [set-version]
93-
uses: th2-net/.github/.github/workflows/python-pypi-publish.yml@python-workflow # FIXME: change to main
80+
# pypi-publish:
81+
# name: Publish to PyPi
82+
# needs: [prebuild-job]
83+
# if: inputs.strict-scanner && success() || !inputs.strict-scanner
84+
# uses: th2-net/.github/.github/workflows/python-pypi-publish.yml@python-workflow # FIXME: change to main
85+
# with:
86+
# version: ${{ needs.prebuild-job.outputs.custom-version }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Get package_version from package_info.json",
3+
"description": "Get value for key in JSON file. Configure to get 'package_version' from `package_info.json` by default",
4+
"iconName": "example-icon"
5+
}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Get package_version from package_info.json
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runsOn:
7+
required: false
8+
type: string
9+
default: 'ubuntu-latest'
10+
outputs:
11+
version:
12+
description: "package_version from package_info.json"
13+
value: ${{ jobs.get-package-version.outputs.version }}
14+
15+
jobs:
16+
get-package-version:
17+
name: 'Get package_version'
18+
runs-on: ${{ inputs.runsOn }}
19+
outputs:
20+
version: ${{ steps.package-version.outputs.prop }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- name: Get package_version value
25+
id: package-version
26+
uses: notiz-dev/github-action-json-property@release
27+
with:
28+
path: package_info.json
29+
prop_path: package_version
30+
- name: Show package_version value
31+
run: echo ${{ steps.package-version.outputs.prop }}

0 commit comments

Comments
 (0)
Please sign in to comment.