Update version in idf_component.yml (#68) #8
Workflow file for this run
This file contains hidden or 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
| 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 }} |