-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add velocitas config update action (#55)
* Add velocitas config update action * Update for slim project config --------- Signed-off-by: Dennis Meister <[email protected]>
- Loading branch information
1 parent
80adbf9
commit 0eeb7a0
Showing
4 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License, Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: update-velocitas-json | ||
description: Update the project's velocitas JSON. | ||
inputs: | ||
project_dir: | ||
description: Directory containing the Velocitas project | ||
required: true | ||
template_file: | ||
description: JSON file which will replace the .velocitas.json file. | ||
default: None | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set commit id | ||
shell: bash | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
BRANCH_NAME_PREFIX: "@" | ||
run: | | ||
if [ "${{ inputs.template_file }}" != "None" ]; then | ||
echo "Copying template file..." | ||
cp -f ${{ inputs.template_file }} ${{ inputs.project_dir }}/.velocitas.json | ||
fi | ||
NEW_CONFIG="$(jq --arg BRANCH "$BRANCH_NAME_PREFIX$BRANCH_NAME" '.packages |= . + { (. | keys_unsorted[0]): $BRANCH }' ${{ inputs.project_dir }}/.velocitas.json)" | ||
echo "${NEW_CONFIG}" > ${{ inputs.project_dir }}/.velocitas.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
{ | ||
"packages": [ | ||
{ | ||
"name": "devenv-github-workflows", | ||
"version": "hash_id" | ||
} | ||
], | ||
"packages": { | ||
"devenv-github-workflows": "hash_id" | ||
}, | ||
"variables": { | ||
"appManifestPath": "app/AppManifest.json", | ||
"language": "cpp", | ||
"repoType": "app", | ||
"appManifestPath": "app/AppManifest.json", | ||
"githubRepoId": "eclipse-velocitas/vehicle-app-cpp-template", | ||
"appExecutionPlatforms": "linux/amd64" | ||
} | ||
"appExecutionPlatforms": "linux/amd64", | ||
"generatedModelPath": "./app/vehicle_model" | ||
}, | ||
"cliVersion": "v0.9.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
{ | ||
"packages": [ | ||
{ | ||
"name": "devenv-github-workflows", | ||
"version": "hash_id" | ||
} | ||
], | ||
"packages": { | ||
"devenv-github-workflows": "hash_id" | ||
}, | ||
"variables": { | ||
"appManifestPath": "app/AppManifest.json", | ||
"language": "python", | ||
"repoType": "app", | ||
"appManifestPath": "app/AppManifest.json", | ||
"githubRepoId": "eclipse-velocitas/vehicle-app-python-template", | ||
"appExecutionPlatforms": "linux/amd64" | ||
} | ||
"generatedModelPath": "./gen/vehicle_model" | ||
}, | ||
"cliVersion": "v0.9.0" | ||
} |