Unverified Commit 0b8eedea authored by Lucas Saavedra Vaz's avatar Lucas Saavedra Vaz Committed by GitHub

ci(release): Make workflows dependent on release completion (#10260)

parent 254c5e43
name: Documentation Build and Production Deploy CI name: Documentation Build and Production Deploy CI
on: on:
release: workflow_run:
types: [published] workflows: ["ESP32 Arduino Release"]
types:
- completed
push: push:
branches: branches:
- release/v2.x - release/v2.x
...@@ -12,7 +14,6 @@ on: ...@@ -12,7 +14,6 @@ on:
- '.github/workflows/docs_deploy.yml' - '.github/workflows/docs_deploy.yml'
jobs: jobs:
deploy-prod-docs: deploy-prod-docs:
name: Deploy Documentation on Production name: Deploy Documentation on Production
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
...@@ -20,6 +21,11 @@ jobs: ...@@ -20,6 +21,11 @@ jobs:
run: run:
shell: bash shell: bash
steps: 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 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
......
name: Push components to https://components.espressif.com name: Push components to https://components.espressif.com
on: on:
push: workflow_run:
tags: workflows: ["ESP32 Arduino Release"]
- '*' types:
- completed
jobs: jobs:
upload_components: upload_components:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 - uses: actions/checkout@v4
with: with:
submodules: "recursive" submodules: "recursive"
...@@ -15,6 +38,6 @@ jobs: ...@@ -15,6 +38,6 @@ jobs:
uses: espressif/upload-components-ci-action@v1 uses: espressif/upload-components-ci-action@v1
with: with:
name: arduino-esp32 name: arduino-esp32
version: ${{ github.ref_name }} version: ${{ env.RELEASE_TAG }}
namespace: espressif namespace: espressif
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }} api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment