ci: Migrate to artifact upload/download for builds (#19688)

Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
Declan Carroll
2025-09-18 10:31:39 +01:00
committed by GitHub
parent bb0cd86b28
commit 5764ef3cc6
2 changed files with 33 additions and 27 deletions

View File

@@ -13,7 +13,7 @@ on:
- '@n8n/scan-community-package'
env:
BUILD_CACHE_KEY: ${{ github.sha }}-${{ github.event.inputs.package }}-build
BUILD_DIST_NAME: ${{ github.sha }}-${{ github.event.inputs.package }}-build
concurrency:
group: release-package-${{ github.event.inputs.package }}
@@ -46,13 +46,15 @@ jobs:
- name: Setup Environment
uses: ./.github/actions/setup-nodejs-blacksmith
with:
build-command: 'pnpm --filter "${{ github.event.inputs.package }}" run --if-present build'
build-command: 'pnpm --filter "...${{ github.event.inputs.package }}" run --if-present build'
- name: Cache build artifacts
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.BUILD_DIST_NAME }}
path: ./packages/**/dist
key: ${{ env.BUILD_CACHE_KEY }}
if-no-files-found: error
retention-days: 7
publish:
name: Publish to NPM
@@ -83,12 +85,11 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Restore build artifacts
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
- name: Download build artifacts
uses: actions/download-artifact@65d862660abb3549b588b37db4038d3fd1a05f8a # v4.1.8
with:
fail-on-cache-miss: true
path: ./packages/**/dist
key: ${{ env.BUILD_CACHE_KEY }}
name: ${{ env.BUILD_DIST_NAME }}
path: .
- name: Pre publishing changes
run: |
@@ -98,4 +99,5 @@ jobs:
- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm --filter "${{ github.event.inputs.package }}" publish --access public --no-git-checks --publish-branch master
PACKAGE: ${{ github.event.inputs.package }}
run: pnpm --filter "$PACKAGE" publish --access public --no-git-checks --publish-branch master