Compare commits

..

1 Commits

Author SHA1 Message Date
eggyhead
a4670586df updating based on toolkit changes in v2.1.0 2024-01-31 20:40:49 +00:00
9 changed files with 52166 additions and 30215 deletions

View File

@@ -1,20 +0,0 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3

View File

@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Update the ${{ env.TAG_NAME }} tag - name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.3.0 uses: actions/publish-action@v0.2.1
with: with:
source-tag: ${{ env.TAG_NAME }} source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }} slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

@@ -1,9 +1,9 @@
--- ---
name: "@actions/artifact" name: "@actions/artifact"
version: 2.3.2 version: 2.0.1
type: npm type: npm
summary: Actions artifact lib summary:
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE.md - sources: LICENSE.md

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/core" name: "@actions/core"
version: 1.10.1 version: 1.10.0
type: npm type: npm
summary: Actions core lib summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core homepage: https://github.com/actions/toolkit/tree/main/packages/core

80449
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -189,8 +189,7 @@ jobs:
- name: Create a File - name: Create a File
run: echo "hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt run: echo "hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt
- name: Upload Artifact - name: Upload Artifact
- uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with: with:
- name: all-my-files - name: all-my-files
+ name: my-artifact-${{ matrix.runs-on }} + name: my-artifact-${{ matrix.runs-on }}
@@ -206,4 +205,4 @@ jobs:
+ pattern: my-artifact-* + pattern: my-artifact-*
``` ```
Note that this will download all artifacts to a temporary directory and reupload them as a single artifact. For more information on inputs and other use cases for `actions/upload-artifact/merge@v4`, see [the action documentation](https://github.com/actions/upload-artifact/blob/main/merge/README.md). Note that this will download all artifacts to a temporary directory and reupload them as a single artifact. For more information on inputs and other use cases for `actions/upload-artifact/merge@v4`, see [the action documentation](../merge/README.md).

1605
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "download-artifact", "name": "download-artifact",
"version": "4.2.0", "version": "4.0.1",
"description": "Download an Actions Artifact from a workflow run", "description": "Download an Actions Artifact from a workflow run",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
@@ -28,8 +28,8 @@
}, },
"homepage": "https://github.com/actions/download-artifact#readme", "homepage": "https://github.com/actions/download-artifact#readme",
"dependencies": { "dependencies": {
"@actions/artifact": "^2.3.2", "@actions/artifact": "^2.0.1",
"@actions/core": "^1.10.1", "@actions/core": "^1.10.0",
"@actions/github": "^5.1.1", "@actions/github": "^5.1.1",
"minimatch": "^9.0.3" "minimatch": "^9.0.3"
}, },

View File

@@ -106,44 +106,30 @@ async function run(): Promise<void> {
core.info(`Preparing to download the following artifacts:`) core.info(`Preparing to download the following artifacts:`)
artifacts.forEach(artifact => { artifacts.forEach(artifact => {
core.info( core.info(
`- ${artifact.name} (ID: ${artifact.id}, Size: ${artifact.size}, Expected Digest: ${artifact.digest})` `- ${artifact.name} (ID: ${artifact.id}, Size: ${artifact.size})`
) )
}) })
} }
const downloadPromises = artifacts.map(artifact => ({ const downloadPromises = artifacts.map(artifact =>
name: artifact.name, artifactClient.downloadArtifact(artifact.id, {
promise: artifactClient.downloadArtifact(artifact.id, {
...options, ...options,
path: path:
isSingleArtifactDownload || inputs.mergeMultiple isSingleArtifactDownload || inputs.mergeMultiple
? resolvedPath ? resolvedPath
: path.join(resolvedPath, artifact.name), : path.join(resolvedPath, artifact.name)
expectedHash: artifact.digest
}) })
})) )
const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS) const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS)
for (const chunk of chunkedPromises) { for (const chunk of chunkedPromises) {
const chunkPromises = chunk.map(item => item.promise) await Promise.all(chunk)
const results = await Promise.all(chunkPromises)
for (let i = 0; i < results.length; i++) {
const outcome = results[i]
const artifactName = chunk[i].name
if (outcome.digestMismatch) {
core.warning(
`Artifact '${artifactName}' digest validation failed. Please verify the integrity of the artifact.`
)
}
} }
core.info(`Total of ${artifacts.length} artifact(s) downloaded`) core.info(`Total of ${artifacts.length} artifact(s) downloaded`)
core.setOutput(Outputs.DownloadPath, resolvedPath) core.setOutput(Outputs.DownloadPath, resolvedPath)
core.info('Download artifact has finished successfully') core.info('Download artifact has finished successfully')
} }
}
run().catch(err => run().catch(err =>
core.setFailed(`Unable to download artifact(s): ${err.message}`) core.setFailed(`Unable to download artifact(s): ${err.message}`)