From ba692058cb66cdaea1d6449ac9e6ae991c7875a8 Mon Sep 17 00:00:00 2001 From: Digikwal <79085106+digikwal@users.noreply.github.com> Date: Thu, 26 Jun 2025 02:10:15 +0200 Subject: [PATCH] feat(ci): add release metadata logic --- .github/workflows/semantic-release.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index f9fe3e1a..60d1f2be 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -7,6 +7,9 @@ on: types: - completed + repository_dispatch: + types: [fieldmate-release] + permissions: actions: write contents: write @@ -15,7 +18,9 @@ permissions: jobs: release: - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: | + (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || + (github.event_name == 'repository_dispatch') runs-on: ubuntu-latest steps: @@ -37,6 +42,12 @@ jobs: run: | npm install --save-dev conventional-changelog-conventionalcommits + - name: Handle Fieldmate Metadata + if: github.event_name == 'repository_dispatch' + run: | + echo "FIELDMATE_VERSION=${{ github.event.client_payload.version }}" >> $GITHUB_ENV + echo "${{ github.event.client_payload.changelog }}" > fieldmate_changelog.txt + - name: Generate release notes and version id: semantic_release env: @@ -55,10 +66,21 @@ jobs: echo "${RELEASE_TAG}" > release_tag.txt echo "${FRAPPE_BRANCH}" > frappe_branch.txt - - name: Upload release metadata + - name: Upload workflow metadata uses: actions/upload-artifact@v4 + if: github.event_name == 'workflow_run' with: name: release-metadata path: | release_tag.txt frappe_branch.txt + + - name: Upload dispatch metadata + uses: actions/upload-artifact@v4 + if: github.event_name == 'repository_dispatch' + with: + name: release-metadata + path: | + release_tag.txt + frappe_branch.txt + fieldmate_changelog.txt