mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
troubleshoot artifact upload
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
e857ff3a52
commit
42c7848016
96
.github/workflows/validations.yaml
vendored
96
.github/workflows/validations.yaml
vendored
@ -88,41 +88,69 @@ jobs:
|
|||||||
run: make snapshot-smoke-test
|
run: make snapshot-smoke-test
|
||||||
|
|
||||||
# upload each platform artifact individually so downstream jobs can download only what they need
|
# upload each platform artifact individually so downstream jobs can download only what they need
|
||||||
- run: npm install @actions/artifact@2.2.2
|
# using explicit upload steps instead of programmatic API for runs-on compatibility
|
||||||
|
- name: Upload Linux amd64 artifact
|
||||||
- name: Upload individual platform artifacts
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
uses: actions/github-script@v8
|
|
||||||
env:
|
|
||||||
ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY: 10
|
|
||||||
with:
|
with:
|
||||||
script: |
|
name: linux-build_linux_amd64_v1
|
||||||
const { readdirSync } = require('fs')
|
path: snapshot/linux-build_linux_amd64_v1
|
||||||
const { DefaultArtifactClient } = require('@actions/artifact')
|
retention-days: 30
|
||||||
const artifact = new DefaultArtifactClient()
|
|
||||||
const ls = d => readdirSync(d, { withFileTypes: true })
|
- name: Upload Linux arm64 artifact
|
||||||
const baseDir = "./snapshot"
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
const dirs = ls(baseDir).filter(f => f.isDirectory()).map(f => f.name)
|
with:
|
||||||
const uploads = []
|
name: linux-build_linux_arm64_v8.0
|
||||||
for (const dir of dirs) {
|
path: snapshot/linux-build_linux_arm64_v8.0
|
||||||
// uploadArtifact returns Promise<{id, size}>
|
retention-days: 30
|
||||||
uploads.push(artifact.uploadArtifact(
|
|
||||||
// name of the archive:
|
- name: Upload Linux ppc64le artifact
|
||||||
`${dir}`,
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
// array of all files to include:
|
with:
|
||||||
ls(`${baseDir}/${dir}`).map(f => `${baseDir}/${dir}/${f.name}`),
|
name: linux-build_linux_ppc64le_power8
|
||||||
// base directory to trim from entries:
|
path: snapshot/linux-build_linux_ppc64le_power8
|
||||||
`${baseDir}/${dir}`,
|
retention-days: 30
|
||||||
{ retentionDays: 30 }
|
|
||||||
))
|
- name: Upload Linux s390x artifact
|
||||||
}
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
// wait for all uploads to finish
|
with:
|
||||||
try {
|
name: linux-build_linux_s390x
|
||||||
const results = await Promise.all(uploads)
|
path: snapshot/linux-build_linux_s390x
|
||||||
console.log(`Successfully uploaded ${results.length} platform artifacts`)
|
retention-days: 30
|
||||||
} catch (error) {
|
|
||||||
console.error('Upload failed:', error)
|
- name: Upload macOS Intel artifact
|
||||||
throw error
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
}
|
with:
|
||||||
|
name: darwin-build_darwin_amd64_v1
|
||||||
|
path: snapshot/darwin-build_darwin_amd64_v1
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
- name: Upload macOS Apple Silicon artifact
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
|
with:
|
||||||
|
name: darwin-build_darwin_arm64_v8.0
|
||||||
|
path: snapshot/darwin-build_darwin_arm64_v8.0
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
- name: Upload Windows amd64 artifact
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
|
with:
|
||||||
|
name: windows-build_windows_amd64_v1
|
||||||
|
path: snapshot/windows-build_windows_amd64_v1
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
- name: Upload Windows arm64 artifact
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
|
with:
|
||||||
|
name: windows-build_windows_arm64_v8.0
|
||||||
|
path: snapshot/windows-build_windows_arm64_v8.0
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
- name: Upload Homebrew artifact
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.0
|
||||||
|
with:
|
||||||
|
name: homebrew
|
||||||
|
path: snapshot/homebrew
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
Acceptance-Linux:
|
Acceptance-Linux:
|
||||||
# Note: changing this job name requires making the same update in the .github/workflows/release.yaml pipeline
|
# Note: changing this job name requires making the same update in the .github/workflows/release.yaml pipeline
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user