diff --git a/.github/workflows/docs_deploy.yml b/.github/workflows/docs_deploy.yml index f5f9be77b24..5393f7e8a20 100644 --- a/.github/workflows/docs_deploy.yml +++ b/.github/workflows/docs_deploy.yml @@ -1,8 +1,10 @@ name: Documentation Build and Production Deploy CI on: - release: - types: [published] + workflow_run: + workflows: ["ESP32 Arduino Release"] + types: + - completed push: branches: - release/v2.x @@ -12,7 +14,6 @@ on: - '.github/workflows/docs_deploy.yml' jobs: - deploy-prod-docs: name: Deploy Documentation on Production runs-on: ubuntu-22.04 @@ -20,6 +21,11 @@ jobs: run: shell: bash steps: + - name: Check if release workflow is successful + if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion != 'success' }} + run: | + echo "Release workflow failed. Exiting..." + exit 1 - uses: actions/checkout@v4 with: submodules: true diff --git a/.github/workflows/upload-idf-component.yml b/.github/workflows/upload-idf-component.yml index ca21361689f..22912de6da0 100644 --- a/.github/workflows/upload-idf-component.yml +++ b/.github/workflows/upload-idf-component.yml @@ -1,12 +1,35 @@ name: Push components to https://components.espressif.com + on: - push: - tags: - - '*' + workflow_run: + workflows: ["ESP32 Arduino Release"] + types: + - completed + jobs: upload_components: runs-on: ubuntu-latest steps: + - name: Get the release tag + run: | + if [ "${{ github.event.workflow_run.conclusion }}" != "success" ]; then + echo "Release workflow failed. Exiting..." + exit 1 + fi + + branch=${{ github.event.workflow_run.head_branch }} + if [[ $branch == refs/tags/* ]]; then + tag="${branch#refs/tags/}" + elif [[ $branch =~ ^[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: submodules: "recursive" @@ -15,6 +38,6 @@ jobs: uses: espressif/upload-components-ci-action@v1 with: name: arduino-esp32 - version: ${{ github.ref_name }} + version: ${{ env.RELEASE_TAG }} namespace: espressif api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}