Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload-artifact@v4 #466

Merged
merged 26 commits into from Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
99700c1
Update upload-artifact for @actions/artifact@v2
bethanyj28 Aug 24, 2023
0f57369
bump @actions/artifact to 2.0.0
bethanyj28 Aug 24, 2023
0597a56
update dist
bethanyj28 Aug 24, 2023
0ff37d0
Merge pull request #430 from bethanyj28/main
bethanyj28 Aug 24, 2023
50ad273
bump linked artifact toolkit pkg
robherley Oct 16, 2023
f87a408
Merge pull request #446 from robherley/v4-beta
robherley Oct 16, 2023
aa5cae1
Add artifact-id output to v4-beta (#448)
konradpabjan Oct 26, 2023
20bcd3b
add compression level input
robherley Nov 20, 2023
59ef34a
bump for more logs
robherley Nov 20, 2023
fa39c94
consume latest @actions/artifact from toolkit
robherley Nov 21, 2023
eeb333d
Merge pull request #453 from actions/robherley/more-v4-improvements
robherley Nov 21, 2023
83b889d
consume latest @actions/artifact
robherley Dec 4, 2023
500e175
Merge pull request #460 from actions/robherley/consume-latest-toolkit
robherley Dec 4, 2023
eba2a24
consume latest @actions/toolkit (#461)
robherley Dec 7, 2023
9a179cd
adding error message improvement
vmjoseph Dec 11, 2023
2a6c27a
Merge pull request #464 from actions/vmjoseph/v4-beta-more-descriptiv…
vmjoseph Dec 11, 2023
6a5077f
update docs and bump @actions/artifact
robherley Dec 13, 2023
1b56155
s/v4-beta/v4/g
robherley Dec 13, 2023
d6437d0
naming
robherley Dec 13, 2023
5e7604f
trim some repeated info
robherley Dec 13, 2023
ecb2146
add compression example
robherley Dec 13, 2023
875b630
add limitations section
robherley Dec 13, 2023
9653d03
Apply suggestions from code review
robherley Dec 13, 2023
f391bb9
Merge pull request #465 from actions/robherley/v4-documentation
robherley Dec 13, 2023
4a6c273
Merge branch 'main' into v4-beta
robherley Dec 13, 2023
13131bb
licensed cache
robherley Dec 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 20 additions & 19 deletions .github/workflows/check-dist.yml
Expand Up @@ -10,43 +10,44 @@ on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node 16
uses: actions/setup-node@v3
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Move the committed index.js file
run: mv dist/index.js /tmp

- name: Rebuild with tsc
- name: Rebuild the dist/ directory
run: npm run build

- name: Rebuild the index.js file
run: npm run release

- name: Compare the expected and actual index.js files
run: git diff --ignore-all-space dist/index.js /tmp/index.js
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4-beta
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: index.js
path: dist/index.js
name: dist
path: dist/
2 changes: 1 addition & 1 deletion .github/workflows/licensed.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: npm ci
- name: Install licensed
run: |
Expand Down
61 changes: 17 additions & 44 deletions .github/workflows/test.yml
@@ -1,4 +1,5 @@
name: Test

on:
push:
branches:
Expand All @@ -10,7 +11,6 @@ on:
- '**.md'

jobs:

build:
name: Build

Expand All @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node 16
uses: actions/setup-node@v3
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
cache: 'npm'

- name: Install dependencies
Expand All @@ -54,43 +54,36 @@ jobs:
mkdir -p path/to/dir-3
echo "Lorem ipsum dolor sit amet" > path/to/dir-1/file1.txt
echo "Hello world from file #2" > path/to/dir-2/file2.txt
echo "This is a going to be a test for a large enough file that should get compressed with GZip. The @actions/artifact package uses GZip to upload files. This text should have a compression ratio greater than 100% so it should get uploaded using GZip" > path/to/dir-3/gzip.txt
# Upload a single file artifact
- name: 'Upload artifact #1'
uses: ./
with:
name: 'Artifact-A'
name: 'Artifact-A-${{ matrix.runs-on }}'
path: path/to/dir-1/file1.txt

# Upload using a wildcard pattern, name should default to 'artifact' if not provided
# Upload using a wildcard pattern
- name: 'Upload artifact #2'
uses: ./
with:
name: 'Artifact-Wildcard-${{ matrix.runs-on }}'
path: path/**/dir*/

# Upload a directory that contains a file that will be uploaded with GZip
# Upload a multi-path artifact
- name: 'Upload artifact #3'
uses: ./
with:
name: 'GZip-Artifact'
path: path/to/dir-3/

# Upload a directory that contains a file that will be uploaded with GZip
- name: 'Upload artifact #4'
uses: ./
with:
name: 'Multi-Path-Artifact'
name: 'Multi-Path-Artifact-${{ matrix.runs-on }}'
path: |
path/to/dir-1/*
path/to/dir-[23]/*
!path/to/dir-3/*.txt
# Download Artifact #1 and verify the correctness of the content
- name: 'Download artifact #1'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4-beta
with:
name: 'Artifact-A'
name: 'Artifact-A-${{ matrix.runs-on }}'
path: some/new/path

- name: 'Verify Artifact #1'
Expand All @@ -108,9 +101,9 @@ jobs:

# Download Artifact #2 and verify the correctness of the content
- name: 'Download artifact #2'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4-beta
with:
name: 'artifact'
name: 'Artifact-Wildcard-${{ matrix.runs-on }}'
path: some/other/path

- name: 'Verify Artifact #2'
Expand All @@ -127,31 +120,11 @@ jobs:
}
shell: pwsh

# Download Artifact #3 and verify the correctness of the content
- name: 'Download artifact #3'
uses: actions/download-artifact@v3
with:
name: 'GZip-Artifact'
path: gzip/artifact/path

# Because a directory was used as input during the upload the parent directories, path/to/dir-3/, should not be included in the uploaded artifact
- name: 'Verify Artifact #3'
run: |
$gzipFile = "gzip/artifact/path/gzip.txt"
if(!(Test-Path -path $gzipFile))
{
Write-Error "Expected file do not exist"
}
if(!((Get-Content $gzipFile) -ceq "This is a going to be a test for a large enough file that should get compressed with GZip. The @actions/artifact package uses GZip to upload files. This text should have a compression ratio greater than 100% so it should get uploaded using GZip"))
{
Write-Error "File contents of downloaded artifact is incorrect"
}
shell: pwsh

# Download Artifact #4 and verify the correctness of the content
- name: 'Download artifact #4'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4-beta
with:
name: 'Multi-Path-Artifact'
name: 'Multi-Path-Artifact-${{ matrix.runs-on }}'
path: multi/artifact

- name: 'Verify Artifact #4'
Expand Down
2 changes: 1 addition & 1 deletion .licenses/npm/@actions/artifact.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .licenses/npm/@actions/github.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .licenses/npm/@actions/http-client.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .licenses/npm/@azure/abort-controller.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions .licenses/npm/@azure/core-auth.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions .licenses/npm/@azure/core-http.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions .licenses/npm/@azure/core-lro.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.