Skip to content

Commit

Permalink
ci: trigger the release build automatically (#2817)
Browse files Browse the repository at this point in the history
* ci: trigger the release build automatically

* ci: fix to get the subject (first line) of the latest commit message
  • Loading branch information
longyulongyu authored Aug 29, 2024
1 parent ffdba64 commit d75276d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/check-release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## If the latest commit message contains '[ci] release main', trigger release-build.yml
name: Check Commit Message

on:
push:
branches:
- main

jobs:
check-commit-message:
runs-on: ubuntu-latest
outputs:
trigger_release: ${{ steps.check_commit_message.outputs.trigger_release }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get commit message
id: get_commit_message
run: echo "message=$(git log -1 --format=%s)" >> $GITHUB_OUTPUT

- name: Check commit message
id: check_commit_message
run: |
if [[ "${{ steps.get_commit_message.outputs.message }}" == *"[ci] release main"* ]]; then
echo "Commit message contains '[ci] release main', triggering release build..."
echo "trigger_release=true" >> $GITHUB_OUTPUT
else
echo "Commit message does not contain '[ci] release main', skipping release build..."
exit 1
fi
trigger-release-build:
needs: check-commit-message
if: needs.check-commit-message.outputs.trigger_release == 'true'
uses: ./.github/workflows/release-build.yml
7 changes: 2 additions & 5 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: Build UMD and Translations

on:
workflow_dispatch:
workflow_call:

jobs:
build-umd-and-translations:
Expand All @@ -31,8 +32,4 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: umd-and-translations
path: packages/lib/dist/umd




path: packages/lib/dist/umd

0 comments on commit d75276d

Please sign in to comment.