Skip to content

Update version in idf_component.yml (#68) #8

Update version in idf_component.yml (#68)

Update version in idf_component.yml (#68) #8

name: Upload component
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Inject version into idf_component.yml on tag
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME}"
echo "Injecting version ${VERSION} into idf_component.yml"
tmpfile="$(mktemp)"
# Remove any existing top-level version field, then prepend the new one
grep -v '^[[:space:]]*version:[[:space:]]*' idf_component.yml > "$tmpfile"
printf 'version: "%s"\n' "$VERSION" > idf_component.yml
cat "$tmpfile" >> idf_component.yml
rm -f "$tmpfile"
echo "Resulting idf_component.yml:" && cat idf_component.yml
- name: Upload component to the registry
uses: espressif/upload-components-ci-action@v1
with:
namespace: "jkent"
name: "frogfs"
version: ${{ github.ref_name }}
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}