mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-15 17:16:45 +00:00
ci: Add blacksmith build step and cache restore (#19563)
This commit is contained in:
2
.actrc
2
.actrc
@@ -2,4 +2,4 @@
|
||||
-P blacksmith-4vcpu-ubuntu-2204=ubuntu-latest
|
||||
-P ubuntu-22.04=ubuntu-latest
|
||||
-P ubuntu-20.04=ubuntu-latest
|
||||
--container-architecture linux/amd64
|
||||
--container-architecture linux/amd64
|
||||
|
||||
2
.github/actionlint.yaml
vendored
2
.github/actionlint.yaml
vendored
@@ -2,3 +2,5 @@ self-hosted-runner:
|
||||
labels:
|
||||
- blacksmith-2vcpu-ubuntu-2204
|
||||
- blacksmith-4vcpu-ubuntu-2204
|
||||
- blacksmith-2vcpu-ubuntu-2204-arm
|
||||
- blacksmith-4vcpu-ubuntu-2204-arm
|
||||
|
||||
2
.github/workflows/docker-build-push.yml
vendored
2
.github/workflows/docker-build-push.yml
vendored
@@ -556,7 +556,7 @@ jobs:
|
||||
|
||||
security-scan:
|
||||
name: Security Scan
|
||||
needs: [determine-build-context, build-and-push-docker]
|
||||
needs: [determine-build-context, build-and-push-docker, create_multi_arch_manifest]
|
||||
if: |
|
||||
success() &&
|
||||
(needs.determine-build-context.outputs.release_type == 'stable' ||
|
||||
|
||||
50
.github/workflows/release-publish.yml
vendored
50
.github/workflows/release-publish.yml
vendored
@@ -7,11 +7,45 @@ on:
|
||||
branches:
|
||||
- 'release/*'
|
||||
|
||||
env:
|
||||
BUILD_CACHE_KEY: ${{ github.sha }}-release:build
|
||||
|
||||
jobs:
|
||||
build-amd64:
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||
if: github.event.pull_request.merged == true
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Environment
|
||||
uses: ./.github/actions/setup-nodejs-blacksmith
|
||||
|
||||
- name: Cache to GH
|
||||
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
with:
|
||||
path: ./packages/**/dist
|
||||
key: ${{ env.BUILD_CACHE_KEY }}
|
||||
|
||||
build-arm64:
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2204-arm
|
||||
if: github.event.pull_request.merged == true
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup and Build ARM64
|
||||
uses: ./.github/actions/setup-nodejs-blacksmith
|
||||
|
||||
publish-to-npm:
|
||||
name: Publish to NPM
|
||||
needs: build-amd64
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.merged == true
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
id-token: write
|
||||
@@ -39,14 +73,12 @@ jobs:
|
||||
- name: Set release version in env
|
||||
run: echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
- name: Cache build artifacts
|
||||
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
- name: Restore build artifacts
|
||||
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
with:
|
||||
fail-on-cache-miss: true
|
||||
path: ./packages/**/dist
|
||||
key: ${{ github.sha }}-release:build
|
||||
key: ${{ env.BUILD_CACHE_KEY }}
|
||||
|
||||
- name: Dry-run publishing
|
||||
run: pnpm publish -r --no-git-checks --dry-run
|
||||
@@ -71,7 +103,7 @@ jobs:
|
||||
|
||||
publish-to-docker-hub:
|
||||
name: Publish to DockerHub
|
||||
needs: [publish-to-npm]
|
||||
needs: [publish-to-npm, build-arm64]
|
||||
uses: ./.github/workflows/docker-build-push.yml
|
||||
with:
|
||||
n8n_version: ${{ needs.publish-to-npm.outputs.release }}
|
||||
@@ -115,7 +147,7 @@ jobs:
|
||||
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
with:
|
||||
path: ./packages/**/dist
|
||||
key: ${{ github.sha }}-release:build
|
||||
key: ${{ env.BUILD_CACHE_KEY }}
|
||||
|
||||
- name: Create a frontend release
|
||||
uses: getsentry/action-release@e769183448303de84c5a06aaaddf9da7be26d6c7 # v1.7.0
|
||||
|
||||
Reference in New Issue
Block a user