mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
ci: Add version release notification workflow (#26897)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5ab71b4ba6
commit
4e1e0cd1c0
32
.github/scripts/send-version-release-notification.mjs
vendored
Normal file
32
.github/scripts/send-version-release-notification.mjs
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { ensureEnvVar } from './github-helpers.mjs';
|
||||
|
||||
async function sendVersionReleaseNotification() {
|
||||
const payload = ensureEnvVar('PAYLOAD');
|
||||
const webhookData = ensureEnvVar('N8N_VERSION_RELEASE_NOTIFICATION_DATA');
|
||||
|
||||
const { user, secret, url } = JSON.parse(webhookData);
|
||||
|
||||
console.log('Payload: ', JSON.parse(payload));
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Basic ' + Buffer.from(`${user}:${secret}`).toString('base64'),
|
||||
},
|
||||
body: payload,
|
||||
});
|
||||
|
||||
const status = response.status;
|
||||
console.log('Webhook call returned status ' + status);
|
||||
|
||||
if (status !== 200) {
|
||||
const body = await response.text();
|
||||
throw new Error(`Webhook call failed:\n\n ${body}`);
|
||||
}
|
||||
}
|
||||
|
||||
// only run when executed directly, not when imported by tests
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
sendVersionReleaseNotification();
|
||||
}
|
||||
|
|
@ -64,3 +64,11 @@ jobs:
|
|||
version: ${{ inputs.version }}
|
||||
experimental: ${{ inputs.release_type == 'rc' }}
|
||||
secrets: inherit
|
||||
|
||||
send-version-release-notification:
|
||||
name: 'Send version release notifications'
|
||||
uses: ./.github/workflows/release-version-release-notification.yml
|
||||
with:
|
||||
previous-version: ${{ inputs.previous_version }}
|
||||
version: ${{ inputs.version }}
|
||||
secrets: inherit
|
||||
|
|
|
|||
50
.github/workflows/release-version-release-notification.yml
vendored
Normal file
50
.github/workflows/release-version-release-notification.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
name: 'Release: Send version release notification'
|
||||
run-name: 'Send version release notification for n8n@${{ inputs.version }}'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
previous-version:
|
||||
description: 'The previous release version (e.g. 2.10.2)'
|
||||
required: true
|
||||
type: string
|
||||
version:
|
||||
description: 'The release version (e.g. 2.11.0)'
|
||||
required: true
|
||||
type: string
|
||||
workflow_call:
|
||||
inputs:
|
||||
previous-version:
|
||||
description: 'The previous release version (e.g. 2.10.2)'
|
||||
required: true
|
||||
type: string
|
||||
version:
|
||||
description: 'The release version (e.g. 2.11.0)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
release-notification:
|
||||
runs-on: ubuntu-slim
|
||||
environment: release
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-nodejs
|
||||
with:
|
||||
build-command: ''
|
||||
install-command: npm install --prefix=.github/scripts --no-package-lock
|
||||
|
||||
- name: Send release notification
|
||||
env:
|
||||
N8N_VERSION_RELEASE_NOTIFICATION_DATA: ${{ secrets.N8N_VERSION_RELEASE_NOTIFICATION_DATA }}
|
||||
PAYLOAD: |
|
||||
{
|
||||
"previous_version": "${{ inputs.previous-version }}",
|
||||
"new_version": "${{ inputs.version }}"
|
||||
}
|
||||
run: node ./.github/scripts/send-version-release-notification.mjs
|
||||
Loading…
Reference in New Issue
Block a user