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
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
......
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 }}
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