Guard DFlash compact verifier by backend #2
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: Dispatch Release | |
| on: | |
| push: | |
| branches: | |
| - "v*" | |
| tags: | |
| - "v*" | |
| permissions: | |
| actions: write | |
| contents: read | |
| jobs: | |
| dispatch: | |
| name: Dispatch main-owned release workflow | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Resolve release inputs | |
| id: meta | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| source_ref="${GITHUB_REF_NAME}" | |
| source_sha="${GITHUB_SHA}" | |
| publish_release="false" | |
| tag_name="" | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| tag_name="${GITHUB_REF_NAME}" | |
| source_sha="$(git rev-list -n 1 "${tag_name}")" | |
| publish_release="true" | |
| elif [[ "${GITHUB_REF}" == refs/heads/v* ]]; then | |
| ref_name_safe="$(printf '%s' "${GITHUB_REF_NAME}" | tr '[:upper:]' '[:lower:]' | sed -E 's#[^a-z0-9_.-]+#-#g; s#^[.-]+##; s#[.-]+$##')" | |
| tag_name="${ref_name_safe}-${source_sha::12}" | |
| else | |
| echo "Unsupported ref ${GITHUB_REF}" >&2 | |
| exit 1 | |
| fi | |
| { | |
| echo "source_ref=${source_ref}" | |
| echo "source_sha=${source_sha}" | |
| echo "tag_name=${tag_name}" | |
| echo "publish_release=${publish_release}" | |
| } >> "${GITHUB_OUTPUT}" | |
| - name: Dispatch release workflow on main | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SOURCE_REF: ${{ steps.meta.outputs.source_ref }} | |
| SOURCE_SHA: ${{ steps.meta.outputs.source_sha }} | |
| TAG_NAME: ${{ steps.meta.outputs.tag_name }} | |
| PUBLISH_RELEASE: ${{ steps.meta.outputs.publish_release }} | |
| run: | | |
| set -euo pipefail | |
| gh workflow run release.yml \ | |
| --ref main \ | |
| --field source_ref="${SOURCE_REF}" \ | |
| --field source_sha="${SOURCE_SHA}" \ | |
| --field tag_name="${TAG_NAME}" \ | |
| --field publish_release="${PUBLISH_RELEASE}" |