Skip to content

Commit

Permalink
Update testaction.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fhoedemakers authored Apr 8, 2024
1 parent a9fdaea commit 116180b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/testaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,25 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive


- name: Update line containing pico_set_program_version() in CMakelists.txt with tag name.
run: |
# Extract the tag name that triggered the event and remove the 'refs/tags/' prefix
input_string=${{ github.ref }}
prefix="refs/tags/"
tag="No versioninfo found"
if [[ $input_string == $prefix* ]]; then
echo "The string starts with 'refs/tags/'."
tag="${input_string#$prefix}"
echo "Tag is ${tag}"
sed -i "s/^[[:space:]]*pico_set_program_version(.*/pico_set_program_version(${{ env.APP_NAME }} \"$tag\")/" CMakeLists.txt
sed -i "s/VX.X/$tag/" menu.h
else
echo "The string does not start with 'refs/tags/'."
fi
grep "pico_set_program_version" CMakeLists.txt
grep SWVERSION menu.h
- name: build source tree
run: |
arm-none-eabi-gcc --version
Expand Down

0 comments on commit 116180b

Please sign in to comment.