|
| 1 | +name: "Application manifest generation" |
| 2 | + |
| 3 | +inputs: |
| 4 | + configuration: |
| 5 | + description: "The configuration file for the application manifest generation" |
| 6 | + required: true |
| 7 | + type: string |
| 8 | + output: |
| 9 | + description: "The output file path for the generated application manifest" |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + version: |
| 13 | + description: "The version to set in the application manifest" |
| 14 | + required: false |
| 15 | + type: string |
| 16 | + name: |
| 17 | + description: "The name to set in the application manifest" |
| 18 | + required: false |
| 19 | + type: string |
| 20 | + meta-data-files: |
| 21 | + description: "Additional metadata files to include in the application manifest" |
| 22 | + required: false |
| 23 | + type: string |
| 24 | + cli-version: |
| 25 | + description: "The version of the qubership-app-manifest-cli to use" |
| 26 | + required: false |
| 27 | + type: string |
| 28 | + default: "main" |
| 29 | + |
| 30 | +outputs: |
| 31 | + app-manifest-path: |
| 32 | + description: "The path to the generated application manifest file" |
| 33 | + value: ${{ steps.generate_app_manifest.outputs.PATH_APP_MANIFEST }} |
| 34 | +runs: |
| 35 | + using: "composite" |
| 36 | + steps: |
| 37 | + - name: "Checkout repository" |
| 38 | + uses: "actions/checkout@v5" |
| 39 | + with: |
| 40 | + repository: netcracker/qubership-app-manifest-cli |
| 41 | + ref: "${{ inputs.cli-version }}" |
| 42 | + path: "app-manifest-cli" |
| 43 | + - name: Configure Python |
| 44 | + uses: actions/setup-python@v4 |
| 45 | + with: |
| 46 | + python-version: '3.12' |
| 47 | + - name: Install dependencies |
| 48 | + shell: bash |
| 49 | + working-directory: app-manifest-cli |
| 50 | + run: | |
| 51 | + python -m venv venv |
| 52 | + source venv/bin/activate |
| 53 | + python -m pip install --upgrade pip |
| 54 | + pip install . |
| 55 | + - name: "Generate application manifest" |
| 56 | + shell: bash |
| 57 | + working-directory: ${{ github.workspace }} |
| 58 | + id: generate_app_manifest |
| 59 | + run: | |
| 60 | + source ./app-manifest-cli/venv/bin/activate |
| 61 | + pip list |
| 62 | + app-manifest generate \ |
| 63 | + --config "${{ inputs.configuration }}" \ |
| 64 | + $([[ -n "${{ inputs.output }}" ]] && echo "--output ${{ inputs.output }}") \ |
| 65 | + $([[ -n "${{ inputs.version }}" ]] && echo "--version ${{ inputs.version }}") \ |
| 66 | + $([[ -n "${{ inputs.name }}" ]] && echo "--name ${{ inputs.name }}") \ |
| 67 | + $([[ -n "${{ inputs.meta-data-files }}" ]] && echo "${{ inputs.meta-data-files }}") |
| 68 | + if [[ -f "am.env" ]]; then |
| 69 | + echo "Sourcing am.env file" |
| 70 | + source am.env |
| 71 | + else |
| 72 | + echo "am.env file not found" |
| 73 | + fi |
| 74 | + echo "Generated application manifest path: $PATH_APP_MANIFEST" |
| 75 | + # echo "PATH_APP_MANIFEST=$([[ -n '${{ inputs.output }}' ]] && echo '${{ inputs.output }}' || echo ${PATH_APP_MANIFEST})" |
| 76 | + echo "PATH_APP_MANIFEST=${PATH_APP_MANIFEST}" >> $GITHUB_OUTPUT |
| 77 | + - name: "Upload application manifest" |
| 78 | + if: ${{ always() && steps.generate_app_manifest.outputs.PATH_APP_MANIFEST }} |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: application-manifest |
| 82 | + path: ${{ steps.generate_app_manifest.outputs.PATH_APP_MANIFEST }} |
0 commit comments