88 - ' __tests__/**'
99 - ' package.json'
1010 - ' yarn.lock'
11- - ' release.config.js'
12- - ' .github/workflows/ci.yml'
1311 branches :
1412 - ' *'
1513 - ' **'
@@ -19,75 +17,90 @@ concurrency:
1917 group : ${{ github.workflow }}-${{ github.ref }}
2018 cancel-in-progress : true
2119
22-
2320env :
2421 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
2522 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2623 CI : true
2724
2825jobs :
29- CI :
26+ test :
27+ name : Test
3028 runs-on : ubuntu-latest
3129 timeout-minutes : 20
3230
3331 permissions :
34- packages : write
3532 contents : write
33+ issues : write
34+ pull-requests : write
35+ id-token : write
36+ packages : write
3637
3738 steps :
38- - run : echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
39-
40- - uses : actions/checkout@v5
39+ - name : Checkout
40+ uses : actions/checkout@v5
4141 with :
42- fetch-depth : 30
43-
44- - uses : FranzDiebold/github-env-vars-action@v2
42+ fetch-depth : 0
43+ persist-credentials : false
4544
4645 - name : Setup Node.js
4746 uses : actions/setup-node@v4
4847 with :
4948 node-version : 24
49+ cache : ' yarn'
5050
51- - name : Yarn
51+ - name : Install dependencies
5252 run : yarn install --frozen-lockfile
5353
54+ - name : Prepare Metadata
55+ run : yarn preparemetadata
56+
57+ - name : Verify dependency integrity
58+ run : yarn audit || true
59+
60+ - name : Lint
61+ run : yarn lint
62+
5463 - name : Test
55- run : |
56- yarn preparemetadata
57- yarn test
64+ run : yarn test
5865
5966 - name : Build
6067 run : yarn build
6168
62- - name : Release
69+ - name : Pre-release (develop branch only)
6370 id : semantic_release
64- if : github.ref == 'refs/heads/develop'
71+ if : github.ref == 'refs/heads/develop' && github.event_name == 'push'
72+ env :
73+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
75+ GIT_AUTHOR_NAME : DEV.ME Team
76+ GIT_AUTHOR_EMAIL :
[email protected] 77+ GIT_COMMITTER_NAME : DEV.ME Team
78+ GIT_COMMITTER_EMAIL :
[email protected] 6579 run : |
66- git config --global user.email "[email protected] " 67- git config --global user.name "DEV.ME Team"
68- npm i -g semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
69- npx semantic-release --no-ci --debug 2>&1 | tee release-output.txt
70-
80+ # Install semantic-release and required plugins
81+ npm i -g semantic-release @semantic-release/git @semantic-release/github @semantic-release/changelog @semantic-release/npm @semantic-release/commit-analyzer
82+
83+ # Run semantic-release
84+ npx semantic-release --debug 2>&1 | tee release-output.txt
85+
7186 # Extract version and tag info from release output
7287 if grep -q "Published release" release-output.txt; then
7388 echo "release_published=true" >> $GITHUB_OUTPUT
74- VERSION=$(grep -oP 'Published release \K[0-9]+\.[0-9]+\.[0-9]+' release-output.txt | head -1)
89+ VERSION=$(grep -oP 'Published release \K[0-9]+\.[0-9]+\.[0-9]+(-.+)? ' release-output.txt | head -1)
7590 echo "version=$VERSION" >> $GITHUB_OUTPUT
7691 echo "tag=v$VERSION" >> $GITHUB_OUTPUT
7792 else
7893 echo "release_published=false" >> $GITHUB_OUTPUT
7994 fi
8095
81- - name : Add CI Summary
96+ - name : Add Release Summary
8297 if : always()
8398 run : |
84- echo "## 🔬 CI Summary" >> $GITHUB_STEP_SUMMARY
99+ echo "## 📦 Release Summary" >> $GITHUB_STEP_SUMMARY
85100 echo "" >> $GITHUB_STEP_SUMMARY
86-
87- # Check if release step was run (only on develop branch)
88- if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
101+
89102 if [[ "${{ steps.semantic_release.outputs.release_published }}" == "true" ]]; then
90- echo "### ✅ Pre-release Published Successfully!" >> $GITHUB_STEP_SUMMARY
103+ echo "### ✅ Release Published Successfully!" >> $GITHUB_STEP_SUMMARY
91104 echo "" >> $GITHUB_STEP_SUMMARY
92105 echo "- **Version:** \`${{ steps.semantic_release.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
93106 echo "- **Tag:** \`${{ steps.semantic_release.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
@@ -98,37 +111,18 @@ jobs:
98111 echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/email-validator-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
99112 echo "- [GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic_release.outputs.tag }})" >> $GITHUB_STEP_SUMMARY
100113 else
101- echo "### ℹ️ No Pre-release Published" >> $GITHUB_STEP_SUMMARY
114+ echo "### ℹ️ No Release Published" >> $GITHUB_STEP_SUMMARY
102115 echo "" >> $GITHUB_STEP_SUMMARY
103- echo "No pre- release was created. This could be because:" >> $GITHUB_STEP_SUMMARY
116+ echo "No release was created. This could be because:" >> $GITHUB_STEP_SUMMARY
104117 echo "- No relevant commits found for release" >> $GITHUB_STEP_SUMMARY
105118 echo "- Commits don't follow conventional commit format" >> $GITHUB_STEP_SUMMARY
106119 echo "- Release conditions not met" >> $GITHUB_STEP_SUMMARY
107120 fi
108- else
109- echo "### ✅ CI Tests Passed" >> $GITHUB_STEP_SUMMARY
110- echo "" >> $GITHUB_STEP_SUMMARY
111- echo "All tests completed successfully on branch \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
112- echo "" >> $GITHUB_STEP_SUMMARY
113- echo "ℹ️ **Note:** Releases are only created from the \`develop\` branch" >> $GITHUB_STEP_SUMMARY
114- fi
115-
121+
116122 echo "" >> $GITHUB_STEP_SUMMARY
117123 echo "### 📊 Build Information" >> $GITHUB_STEP_SUMMARY
118124 echo "- **Workflow:** \`${{ github.workflow }}\`" >> $GITHUB_STEP_SUMMARY
119- echo "- **Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
120- echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
121125 echo "- **Run ID:** \`${{ github.run_id }}\`" >> $GITHUB_STEP_SUMMARY
122126 echo "- **Run Number:** \`${{ github.run_number }}\`" >> $GITHUB_STEP_SUMMARY
123127 echo "- **Actor:** \`${{ github.actor }}\`" >> $GITHUB_STEP_SUMMARY
124128 echo "- **Event:** \`${{ github.event_name }}\`" >> $GITHUB_STEP_SUMMARY
125-
126- # Add PR information if available
127- if [[ "${{ github.event_name }}" == "pull_request" ]]; then
128- echo "" >> $GITHUB_STEP_SUMMARY
129- echo "### 🔀 Pull Request Information" >> $GITHUB_STEP_SUMMARY
130- echo "- **PR Number:** #${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY
131- echo "- **PR Title:** ${{ github.event.pull_request.title }}" >> $GITHUB_STEP_SUMMARY
132- echo "- **Base Branch:** \`${{ github.event.pull_request.base.ref }}\`" >> $GITHUB_STEP_SUMMARY
133- echo "- **Head Branch:** \`${{ github.event.pull_request.head.ref }}\`" >> $GITHUB_STEP_SUMMARY
134- fi
0 commit comments