mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-23 00:05:09 +00:00
ci: Merge workflows: Pre-commit and Lint into Semantic Release
- Combined the `Pre-commit` and `Lint` workflows under the `on.workflow_run` trigger in the Semantic Release workflow. - Unified steps for dependency installation, testing, and release note generation. - Added handling for `FRAPPE_BRANCH` to ensure metadata files are created and uploaded consistently. - Reduced redundancy and improved maintainability of the workflow configuration.
This commit is contained in:
parent
2263f1396b
commit
f0c32f6a67
1 changed files with 8 additions and 4 deletions
12
.github/workflows/semantic-release.yml
vendored
12
.github/workflows/semantic-release.yml
vendored
|
|
@ -3,7 +3,7 @@ name: Semantic Release
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows:
|
workflows:
|
||||||
- Lint
|
- Pre-commit
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
|
|
@ -33,19 +33,23 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
|
- name: Install conventional changelog
|
||||||
|
run: |
|
||||||
|
npm install --save-dev conventional-changelog-conventionalcommits
|
||||||
|
|
||||||
- name: Generate release notes and version
|
- name: Generate release notes and version
|
||||||
id: semantic_release
|
id: semantic_release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
RELEASE_TAG=$(npx semantic-release | tee /dev/stderr | grep -oP '(?<=next release version is )[^ ]+')
|
RELEASE_TAG=$(npx semantic-release | tee /dev/stderr | grep -oP '(?<=next release version is )[^ ]+')
|
||||||
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
|
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Create release metadata files
|
- name: Create release metadata files
|
||||||
run: |
|
run: |
|
||||||
# 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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue