Skip to content

Commit 72f7076

Browse files
committed
feat: added download metadata files
1 parent eb65858 commit 72f7076

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

.github/actions/app-manifest/action.yaml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: "Application manifest generation"
22

33
inputs:
4+
cli-version:
5+
description: "The version of the qubership-app-manifest-cli to use"
6+
required: false
7+
type: string
8+
default: "main"
49
configuration:
510
description: "The configuration file for the application manifest generation"
611
required: true
@@ -18,14 +23,13 @@ inputs:
1823
required: false
1924
type: string
2025
meta-data-files:
21-
description: "Additional metadata files to include in the application manifest"
26+
description: "Additional metadata files to include in the application manifest. Mutually exclusive with download-metadata-files"
2227
required: false
2328
type: string
24-
cli-version:
25-
description: "The version of the qubership-app-manifest-cli to use"
29+
download-metadata-files:
30+
description: "Whether to download metadata files from actions artifacts. Mutually exclusive with meta-data-files"
2631
required: false
27-
type: string
28-
default: "main"
32+
type: boolean
2933

3034
outputs:
3135
app-manifest-path:
@@ -40,10 +44,31 @@ runs:
4044
repository: netcracker/qubership-app-manifest-cli
4145
ref: "${{ inputs.cli-version }}"
4246
path: "app-manifest-cli"
47+
persistent-credentials: false
48+
49+
- name: "Download metadata files"
50+
if: ${{ inputs.download-metadata-files }}
51+
uses: actions/download-artifact@v5
52+
with:
53+
path: "./cli/meta-data-files"
54+
merge-multiple: true
55+
pattern: "*.json"
56+
57+
- name: Collect metadata files
58+
if: ${{ inputs.download-metadata-files }}
59+
run: |
60+
meta_data_files=""
61+
for file in ./cli/meta-data-files/*.json; do
62+
meta_data_files="$meta_data_files $file"
63+
done
64+
echo "[DEBUG] Metadata files: ${meta_data_files}"
65+
echo "META_DATA_FILES=${meta_data_files}" >> $GITHUB_ENV
66+
4367
- name: Configure Python
4468
uses: actions/setup-python@v4
4569
with:
4670
python-version: '3.12'
71+
4772
- name: Install dependencies
4873
shell: bash
4974
working-directory: app-manifest-cli
@@ -52,6 +77,7 @@ runs:
5277
source venv/bin/activate
5378
python -m pip install --upgrade pip
5479
pip install .
80+
5581
- name: "Generate application manifest"
5682
shell: bash
5783
working-directory: ${{ github.workspace }}
@@ -64,7 +90,7 @@ runs:
6490
$([[ -n "${{ inputs.output }}" ]] && echo "--output ${{ inputs.output }}") \
6591
$([[ -n "${{ inputs.version }}" ]] && echo "--version ${{ inputs.version }}") \
6692
$([[ -n "${{ inputs.name }}" ]] && echo "--name ${{ inputs.name }}") \
67-
$([[ -n "${{ inputs.meta-data-files }}" ]] && echo "${{ inputs.meta-data-files }}")
93+
$([[ -n "${{ inputs.meta-data-files }}" ]] && echo "${{ inputs.meta-data-files || env.META_DATA_FILES }}")
6894
if [[ -f "am.env" ]]; then
6995
echo "Sourcing am.env file"
7096
source am.env
@@ -74,6 +100,7 @@ runs:
74100
echo "Generated application manifest path: $PATH_APP_MANIFEST"
75101
# echo "PATH_APP_MANIFEST=$([[ -n '${{ inputs.output }}' ]] && echo '${{ inputs.output }}' || echo ${PATH_APP_MANIFEST})"
76102
echo "PATH_APP_MANIFEST=${PATH_APP_MANIFEST}" >> $GITHUB_OUTPUT
103+
77104
- name: "Upload application manifest"
78105
if: ${{ always() && steps.generate_app_manifest.outputs.PATH_APP_MANIFEST }}
79106
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)