Publish ESP-IDF Component #2
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: Publish ESP-IDF Component | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Version to push to the component registry' | |
| required: true | |
| git_ref: | |
| description: 'Git ref with the source to push to the component registry' | |
| required: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| upload_components: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get the release tag | |
| env: | |
| head_branch: ${{ inputs.tag || github.event.workflow_run.head_branch }} | |
| run: | | |
| # Read and sanitize the branch/tag name | |
| branch=$(echo "$head_branch" | tr -cd '[:alnum:]/_.-') | |
| if [[ $branch == refs/tags/* ]]; then | |
| tag="${branch#refs/tags/}" | |
| elif [[ $branch =~ ^[v]*[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then | |
| tag=$branch | |
| else | |
| echo "Tag not found in $branch. Exiting..." | |
| exit 1 | |
| fi | |
| echo "Tag: $tag" | |
| echo "RELEASE_TAG=$tag" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.git_ref || env.RELEASE_TAG }} | |
| submodules: "recursive" | |
| - name: Upload components to the component registry | |
| uses: espressif/upload-components-ci-action@v1 | |
| with: | |
| name: asynctcp | |
| version: ${{ env.RELEASE_TAG }} | |
| namespace: esp32async | |
| api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }} |