fix: refactor workflow logic

This commit is contained in:
Digikwal 2025-06-26 15:54:52 +02:00 committed by GitHub
parent ba692058cb
commit 91a59014e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,9 +7,6 @@ on:
types: types:
- completed - completed
repository_dispatch:
types: [fieldmate-release]
permissions: permissions:
actions: write actions: write
contents: write contents: write
@ -19,8 +16,7 @@ permissions:
jobs: jobs:
release: release:
if: | if: |
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'
(github.event_name == 'repository_dispatch')
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -42,12 +38,6 @@ jobs:
run: | run: |
npm install --save-dev conventional-changelog-conventionalcommits 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 - name: Generate release notes and version
id: semantic_release id: semantic_release
env: env:
@ -61,26 +51,14 @@ jobs:
# Determine FRAPPE_BRANCH if not already set # Determine FRAPPE_BRANCH if not already set
FRAPPE_BRANCH=${{ vars.FRAPPE_BRANCH || 'version-15' }} FRAPPE_BRANCH=${{ vars.FRAPPE_BRANCH || 'version-15' }}
echo "FRAPPE_BRANCH=${FRAPPE_BRANCH}" >> $GITHUB_ENV echo "FRAPPE_BRANCH=${FRAPPE_BRANCH}" >> $GITHUB_ENV
# Save metadata to files # Save metadata to files
echo "${RELEASE_TAG}" > release_tag.txt echo "${RELEASE_TAG}" > release_tag.txt
echo "${FRAPPE_BRANCH}" > frappe_branch.txt echo "${FRAPPE_BRANCH}" > frappe_branch.txt
- name: Upload workflow metadata - name: Upload workflow metadata
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: github.event_name == 'workflow_run'
with: with:
name: release-metadata name: release-metadata
path: | path: |
release_tag.txt release_tag.txt
frappe_branch.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