frappe_docker/.github/workflows/semantic-release.yml
Digikwal a94b12dfc4
chore: add Makefile
Includes the following targets:
- `make lint`     → Run pre-commit hook for trailing whitespace
- `make format`   → Apply Prettier formatting across the repo
- `make push`     → Add, commit (with prompt), and push changes
- `make amend`    → Amend the last commit without editing message
- `make help`     → Show usage guide

Also includes optional extras like hook installation and reset utilities.
2025-06-26 22:04:21 +02:00

57 lines
1.4 KiB
YAML

# .github/workflows/semantic-release.yml
name: Semantic Release
on:
workflow_run:
workflows:
- Release Trigger
types:
- completed
permissions:
contents: write
issues: write
pull-requests: write
jobs:
release:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Run Semantic Release
id: semantic_release
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
run: |
set +e
OUTPUT=$(npx semantic-release 2>&1)
STATUS=$?
echo "$OUTPUT" | tee /dev/stderr
if [[ $STATUS -eq 0 ]]; then
# Extract release tag
RELEASE_TAG=$(echo "$OUTPUT" | grep -oP '(?<=next release version is )[^ ]+')
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
exit 0
elif [[ $STATUS -eq 1 && "$OUTPUT" == *"There are no relevant changes"* ]]; then
echo "No release needed. semantic-release exited cleanly."
exit 0
else
echo "❌ semantic-release failed with unexpected error (exit $STATUS)."
exit $STATUS
fi