mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-25 08:55:08 +00:00
ci: semantic-release workflow with safe sequencing and test gate
- Triggers only after 'Release Trigger' workflow confirms 'Check' passed - Runs full semantic-release with test gate - Removes redundant changelog plugin install - Exports release tag as artifact for use in downstream Docker build
This commit is contained in:
parent
e827431900
commit
46748bbb5b
1 changed files with 10 additions and 23 deletions
33
.github/workflows/semantic-release.yml
vendored
33
.github/workflows/semantic-release.yml
vendored
|
|
@ -1,27 +1,26 @@
|
||||||
|
# .github/workflows/semantic-release.yml
|
||||||
name: Semantic Release
|
name: Semantic Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows:
|
workflows:
|
||||||
- Lint
|
- Release Trigger
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
actions: write
|
|
||||||
contents: write
|
contents: write
|
||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
if: |
|
if: github.event.workflow_run.conclusion == 'success'
|
||||||
github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
|
@ -29,16 +28,12 @@ jobs:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm ci
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
- name: Install conventional changelog
|
- name: Run Semantic Release
|
||||||
run: |
|
|
||||||
npm install --save-dev conventional-changelog-conventionalcommits
|
|
||||||
|
|
||||||
- name: Generate release notes and version
|
|
||||||
id: semantic_release
|
id: semantic_release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
@ -46,19 +41,11 @@ jobs:
|
||||||
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: Save release tag
|
||||||
run: |
|
run: echo "${RELEASE_TAG}" > release_tag.txt
|
||||||
# Determine FRAPPE_BRANCH if not already set
|
|
||||||
FRAPPE_BRANCH=${{ vars.FRAPPE_BRANCH || 'version-15' }}
|
|
||||||
echo "FRAPPE_BRANCH=${FRAPPE_BRANCH}" >> $GITHUB_ENV
|
|
||||||
# Save metadata to files
|
|
||||||
echo "${RELEASE_TAG}" > release_tag.txt
|
|
||||||
echo "${FRAPPE_BRANCH}" > frappe_branch.txt
|
|
||||||
|
|
||||||
- name: Upload workflow metadata
|
- name: Upload release metadata
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: release-metadata
|
name: release-metadata
|
||||||
path: |
|
path: release_tag.txt
|
||||||
release_tag.txt
|
|
||||||
frappe_branch.txt
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue