mirror of
https://github.com/n8n-io/n8n.git
synced 2025-11-20 17:46:34 +00:00
ci: Add workflow to build on windows (#19937)
This commit is contained in:
parent
68e00955ec
commit
b8895edb94
81
.github/workflows/build-windows.yml
vendored
Normal file
81
.github/workflows/build-windows.yml
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
name: Windows CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
notify_on_failure:
|
||||
description: 'Send Slack notification on build failure'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
workflow_call:
|
||||
inputs:
|
||||
notify_on_failure:
|
||||
description: 'Send Slack notification on build failure'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
secrets:
|
||||
QBOT_SLACK_TOKEN:
|
||||
required: false
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- '**/package.json'
|
||||
- '**/turbo.json'
|
||||
- '.github/workflows/build-windows.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Setup Node.js and Build
|
||||
uses: ./.github/actions/setup-nodejs-github
|
||||
with:
|
||||
build-command: pnpm build
|
||||
|
||||
- name: Send Slack notification on failure
|
||||
if: failure() && inputs.notify_on_failure == true
|
||||
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
|
||||
with:
|
||||
method: chat.postMessage
|
||||
token: ${{ secrets.QBOT_SLACK_TOKEN }}
|
||||
payload: |
|
||||
{
|
||||
"channel": "C035KBDA917",
|
||||
"text": "🚨 Windows build failed for `${{ github.repository }}` on branch `${{ github.ref_name }}`",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "header",
|
||||
"text": { "type": "plain_text", "text": "🚨 Windows Build Failed" }
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"fields": [
|
||||
{ "type": "mrkdwn", "text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>" },
|
||||
{ "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" },
|
||||
{ "type": "mrkdwn", "text": "*Commit:*\n`${{ github.sha }}`" },
|
||||
{ "type": "mrkdwn", "text": "*Trigger:*\n${{ github.event_name }}" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"text": { "type": "mrkdwn", "text": ":warning: *Cross-platform compatibility issue detected*\nThis likely indicates Unix-specific commands in package.json scripts or build configuration that don't work on Windows." }
|
||||
},
|
||||
{
|
||||
"type": "actions",
|
||||
"elements": [
|
||||
{
|
||||
"type": "button",
|
||||
"text": { "type": "plain_text", "text": ":github: View Workflow Run" },
|
||||
"style": "danger",
|
||||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"clean": "rimraf dist .turbo .build",
|
||||
"popularity-cache-marker": "mkdir -p .build && date +%G-W%V > .build/cache-marker",
|
||||
"popularity-cache-marker": "node scripts/cache-marker.mjs",
|
||||
"fetch-popularity": "node scripts/fetch-node-popularity.mjs",
|
||||
"build": "cross-env VUE_APP_PUBLIC_PATH=\"/{{BASE_PATH}}/\" NODE_OPTIONS=\"--max-old-space-size=8192\" vite build",
|
||||
"typecheck": "vue-tsc --noEmit",
|
||||
|
||||
11
packages/frontend/editor-ui/scripts/cache-marker.mjs
Normal file
11
packages/frontend/editor-ui/scripts/cache-marker.mjs
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
import { mkdirSync, writeFileSync } from 'fs';
|
||||
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const week = Math.ceil(
|
||||
((now - new Date(year, 0, 1)) / 86400000 + new Date(year, 0, 1).getDay() + 1) / 7,
|
||||
);
|
||||
|
||||
mkdirSync('.build', { recursive: true });
|
||||
writeFileSync('.build/cache-marker', `${year}-W${week.toString().padStart(2, '0')}`);
|
||||
@ -13,7 +13,8 @@
|
||||
},
|
||||
"build": {
|
||||
"dependsOn": ["^build", "fetch-popularity"],
|
||||
"outputs": ["dist/**"]
|
||||
"outputs": ["dist/**"],
|
||||
"inputs": ["!.build/**"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user