44 push :
55 tags :
66 - ' v*'
7- workflow_dispatch :
8- inputs :
9- version :
10- description : ' Version to release (e.g., 1.0.0)'
11- required : true
12- type : string
13- release_type :
14- description : ' Type of release'
15- required : true
16- default : ' patch'
17- type : choice
18- options :
19- - patch
20- - minor
21- - major
227
238env :
249 NODE_VERSION : ' 18.x'
@@ -37,14 +22,10 @@ jobs:
3722 with :
3823 fetch-depth : 0
3924
40- - name : Get version from tag or input
25+ - name : Get version from tag
4126 id : get_version
4227 run : |
43- if [ "${{ github.event_name }}" = "push" ]; then
44- VERSION=${GITHUB_REF#refs/tags/v}
45- else
46- VERSION="${{ github.event.inputs.version }}"
47- fi
28+ VERSION=${GITHUB_REF#refs/tags/v}
4829 echo "version=${VERSION}" >> $GITHUB_OUTPUT
4930 echo "Detected version: ${VERSION}"
5031
5940 - name : Check if should release
6041 id : should_release
6142 run : |
62- if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
63- echo "result=true" >> $GITHUB_OUTPUT
64- else
65- echo "result=true" >> $GITHUB_OUTPUT
66- fi
43+ echo "result=true" >> $GITHUB_OUTPUT
6744
6845 build-and-test :
6946 name : Build and Test for Release
@@ -100,14 +77,15 @@ jobs:
10077 - name : Build project
10178 run : pnpm run build
10279
103- - name : Update version in package.json
104- if : github.event_name == 'workflow_dispatch'
80+ - name : Verify version consistency
10581 run : |
106- NEW_VERSION="${{ needs.validate-release.outputs.version }}"
107- pnpm version --no-git-tag-version "${NEW_VERSION}"
108-
109- - name : Update node version
110- run : node scripts/update-node-json.js
82+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
83+ TAG_VERSION="${{ needs.validate-release.outputs.version }}"
84+ if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
85+ echo "Error: package.json version ($PACKAGE_VERSION) doesn't match tag version ($TAG_VERSION)"
86+ exit 1
87+ fi
88+ echo "✅ Version consistency verified: $PACKAGE_VERSION"
11189
11290 - name : Pack package
11391 run : pnpm pack
@@ -149,12 +127,6 @@ jobs:
149127 - name : Install dependencies
150128 run : pnpm install --frozen-lockfile
151129
152- - name : Update version in package.json
153- if : github.event_name == 'workflow_dispatch'
154- run : |
155- NEW_VERSION="${{ needs.validate-release.outputs.version }}"
156- pnpm version --no-git-tag-version "${NEW_VERSION}"
157-
158130 - name : Build project
159131 run : pnpm run build
160132
@@ -194,12 +166,6 @@ jobs:
194166 - name : Install dependencies
195167 run : pnpm install --frozen-lockfile
196168
197- - name : Update version in package.json
198- if : github.event_name == 'workflow_dispatch'
199- run : |
200- NEW_VERSION="${{ needs.validate-release.outputs.version }}"
201- pnpm version --no-git-tag-version "${NEW_VERSION}"
202-
203169 - name : Build project
204170 run : pnpm run build
205171
@@ -208,106 +174,21 @@ jobs:
208174 env :
209175 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
210176
211- create-release :
212- name : Create GitHub Release
213- runs-on : ubuntu-latest
214- needs : [validate-release, build-and-test, publish-github]
215- if : needs.validate-release.outputs.should_release == 'true'
216- permissions :
217- contents : write
218- pull-requests : write
219- steps :
220- - name : Checkout code
221- uses : actions/checkout@v4
222- with :
223- fetch-depth : 0
224-
225- - name : Download release artifacts
226- uses : actions/download-artifact@v4
227- with :
228- name : release-package
229-
230- - name : Generate changelog
231- id : changelog
232- run : |
233- VERSION="v${{ needs.validate-release.outputs.version }}"
234- PREV_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
235-
236- if [ -z "$PREV_TAG" ]; then
237- CHANGELOG="🎉 Initial release of Scrappey n8n Node v${{ needs.validate-release.outputs.version }}"
238- else
239- CHANGELOG=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s" --no-merges)
240- if [ -z "$CHANGELOG" ]; then
241- CHANGELOG="- Bug fixes and improvements"
242- fi
243- fi
244-
245- {
246- echo "changelog<<EOF"
247- echo "## What's Changed"
248- echo ""
249- echo "$CHANGELOG"
250- echo ""
251- echo "## Installation"
252- echo ""
253- echo "### From GitHub Packages:"
254- echo '```bash'
255- echo "npm install @automations-project/n8n-nodes-scrappey@${{ needs.validate-release.outputs.version }}"
256- echo '```'
257- echo ""
258- echo "### In n8n:"
259- echo "1. Go to Settings → Community Nodes"
260- echo "2. Enter: \`@automations-project/n8n-nodes-scrappey\`"
261- echo "3. Click Install"
262- echo ""
263- echo "## Features"
264- echo "- 🛠️ **Request Builder**: Create customized HTTP/browser requests"
265- echo "- 🔁 **Auto-Retry HTTP**: Automatically retry failed HTTP requests"
266- echo "- 🌐 **Auto-Retry Browser**: Browser-based retry with anti-bot protection"
267- echo "- 🔒 **Anti-Bot Bypass**: Handle Cloudflare, Datadome, hCaptcha, reCAPTCHA"
268- echo "- 🌍 **Proxy Support**: Residential, datacenter, and mobile proxies"
269- echo "- 🎯 **Country Targeting**: Geo-targeted proxy selection"
270- echo ""
271- echo "**Full Changelog**: https://github.com/Automations-Project/n8n-nodes-scrappey/compare/${PREV_TAG}...${VERSION}"
272- echo "EOF"
273- } >> $GITHUB_OUTPUT
274-
275- - name : Create Release
276- uses : actions/create-release@v1
277- env :
278- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
279- with :
280- tag_name : v${{ needs.validate-release.outputs.version }}
281- release_name : v${{ needs.validate-release.outputs.version }}
282- body : ${{ steps.changelog.outputs.changelog }}
283- draft : false
284- prerelease : false
285-
286- - name : Upload Release Asset
287- uses : actions/upload-release-asset@v1
288- env :
289- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
290- with :
291- upload_url : ${{ steps.create_release.outputs.upload_url }}
292- asset_path : ./automations-project-n8n-nodes-scrappey-${{ needs.validate-release.outputs.version }}.tgz
293- asset_name : n8n-nodes-scrappey-${{ needs.validate-release.outputs.version }}.tgz
294- asset_content_type : application/gzip
295-
296177 notify :
297178 name : Notify Success
298179 runs-on : ubuntu-latest
299- needs : [validate-release, create-release ]
180+ needs : [validate-release, publish-github ]
300181 if : always() && needs.validate-release.outputs.should_release == 'true'
301182 steps :
302183 - name : Success notification
303- if : needs.create-release .result == 'success'
184+ if : needs.publish-github .result == 'success'
304185 run : |
305- echo "🎉 Successfully released v${{ needs.validate-release.outputs.version }}"
186+ echo "🎉 Successfully published v${{ needs.validate-release.outputs.version }}"
306187 echo "📦 Package published to GitHub Packages"
307- echo "🏷️ GitHub release created"
188+ echo "🏷️ GitHub release created by auto-version workflow "
308189
309190 - name : Failure notification
310- if : needs.create-release .result == 'failure'
191+ if : needs.publish-github .result == 'failure'
311192 run : |
312- echo "❌ Release failed for v${{ needs.validate-release.outputs.version }}"
193+ echo "❌ Publishing failed for v${{ needs.validate-release.outputs.version }}"
313194 exit 1
0 commit comments