mirror of
https://github.com/actions/upload-artifact.git
synced 2026-04-10 17:38:27 +01:00
Readme: bump all the example versions to v7
This commit is contained in:
44
README.md
44
README.md
@@ -67,7 +67,7 @@ You are welcome to still raise bugs in this repo.
|
|||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
# Name of the artifact to upload.
|
# Name of the artifact to upload.
|
||||||
# Optional. Default is 'artifact'
|
# Optional. Default is 'artifact'
|
||||||
@@ -131,7 +131,7 @@ You are welcome to still raise bugs in this repo.
|
|||||||
steps:
|
steps:
|
||||||
- run: mkdir -p path/to/artifact
|
- run: mkdir -p path/to/artifact
|
||||||
- run: echo hello > path/to/artifact/world.txt
|
- run: echo hello > path/to/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/to/artifact/world.txt
|
path: path/to/artifact/world.txt
|
||||||
@@ -143,7 +143,7 @@ steps:
|
|||||||
steps:
|
steps:
|
||||||
- run: mkdir -p path/to/artifact
|
- run: mkdir -p path/to/artifact
|
||||||
- run: echo hello > path/to/artifact/world.txt
|
- run: echo hello > path/to/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: path/to/artifact/world.txt
|
path: path/to/artifact/world.txt
|
||||||
archive: false
|
archive: false
|
||||||
@@ -152,7 +152,7 @@ steps:
|
|||||||
### Upload an Entire Directory
|
### Upload an Entire Directory
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/to/artifact/ # or path/to/artifact
|
path: path/to/artifact/ # or path/to/artifact
|
||||||
@@ -161,7 +161,7 @@ steps:
|
|||||||
### Upload using a Wildcard Pattern
|
### Upload using a Wildcard Pattern
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/**/[abc]rtifac?/*
|
path: path/**/[abc]rtifac?/*
|
||||||
@@ -170,7 +170,7 @@ steps:
|
|||||||
### Upload using Multiple Paths and Exclusions
|
### Upload using Multiple Paths and Exclusions
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: |
|
path: |
|
||||||
@@ -218,7 +218,7 @@ For instance, if you are uploading random binary data, you can save a lot of tim
|
|||||||
- name: Make a 1GB random binary file
|
- name: Make a 1GB random binary file
|
||||||
run: |
|
run: |
|
||||||
dd if=/dev/urandom of=my-1gb-file bs=1M count=1000
|
dd if=/dev/urandom of=my-1gb-file bs=1M count=1000
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: my-1gb-file
|
path: my-1gb-file
|
||||||
@@ -231,7 +231,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
|
|||||||
- name: Make a file with a lot of repeated text
|
- name: Make a file with a lot of repeated text
|
||||||
run: |
|
run: |
|
||||||
for i in {1..100000}; do echo -n 'foobar' >> foobar.txt; done
|
for i in {1..100000}; do echo -n 'foobar' >> foobar.txt; done
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: foobar.txt
|
path: foobar.txt
|
||||||
@@ -243,7 +243,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
|
|||||||
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found:
|
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: path/to/artifact/
|
path: path/to/artifact/
|
||||||
@@ -256,13 +256,13 @@ Unlike earlier versions of `upload-artifact`, uploading to the same artifact via
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- run: echo hi > world.txt
|
- run: echo hi > world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
# implicitly named as 'artifact'
|
# implicitly named as 'artifact'
|
||||||
path: world.txt
|
path: world.txt
|
||||||
|
|
||||||
- run: echo howdy > extra-file.txt
|
- run: echo howdy > extra-file.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
# also implicitly named as 'artifact', will fail here!
|
# also implicitly named as 'artifact', will fail here!
|
||||||
path: extra-file.txt
|
path: extra-file.txt
|
||||||
@@ -288,7 +288,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: ./some-script --version=${{ matrix.version }} > my-binary
|
run: ./some-script --version=${{ matrix.version }} > my-binary
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: binary-${{ matrix.os }}-${{ matrix.version }}
|
name: binary-${{ matrix.os }}-${{ matrix.version }}
|
||||||
path: my-binary
|
path: my-binary
|
||||||
@@ -306,7 +306,7 @@ You can use `~` in the path input as a substitute for `$HOME`. Basic tilde expan
|
|||||||
- run: |
|
- run: |
|
||||||
mkdir -p ~/new/artifact
|
mkdir -p ~/new/artifact
|
||||||
echo hello > ~/new/artifact/world.txt
|
echo hello > ~/new/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifacts
|
name: my-artifacts
|
||||||
path: ~/new/**/*
|
path: ~/new/**/*
|
||||||
@@ -321,7 +321,7 @@ Environment variables along with context expressions can also be used for input.
|
|||||||
- run: |
|
- run: |
|
||||||
mkdir -p ${{ github.workspace }}/artifact
|
mkdir -p ${{ github.workspace }}/artifact
|
||||||
echo hello > ${{ github.workspace }}/artifact/world.txt
|
echo hello > ${{ github.workspace }}/artifact/world.txt
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ env.name }}-name
|
name: ${{ env.name }}-name
|
||||||
path: ${{ github.workspace }}/artifact/**/*
|
path: ${{ github.workspace }}/artifact/**/*
|
||||||
@@ -335,7 +335,7 @@ For environment variables created in other steps, make sure to use the `env` exp
|
|||||||
mkdir testing
|
mkdir testing
|
||||||
echo "This is a file to upload" > testing/file.txt
|
echo "This is a file to upload" > testing/file.txt
|
||||||
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
|
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: artifact
|
name: artifact
|
||||||
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
|
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
|
||||||
@@ -350,7 +350,7 @@ Artifacts are retained for 90 days by default. You can specify a shorter retenti
|
|||||||
run: echo "I won't live long" > my_file.txt
|
run: echo "I won't live long" > my_file.txt
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: my_file.txt
|
path: my_file.txt
|
||||||
@@ -366,7 +366,7 @@ If an artifact upload is successful then an `artifact-id` output is available. T
|
|||||||
#### Example output between steps
|
#### Example output between steps
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
id: artifact-upload-step
|
id: artifact-upload-step
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
@@ -385,7 +385,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
output1: ${{ steps.artifact-upload-step.outputs.artifact-id }}
|
output1: ${{ steps.artifact-upload-step.outputs.artifact-id }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
id: artifact-upload-step
|
id: artifact-upload-step
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
@@ -411,7 +411,7 @@ jobs:
|
|||||||
- name: Create a file
|
- name: Create a file
|
||||||
run: echo "hello world" > my-file.txt
|
run: echo "hello world" > my-file.txt
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact # NOTE: same artifact name
|
name: my-artifact # NOTE: same artifact name
|
||||||
path: my-file.txt
|
path: my-file.txt
|
||||||
@@ -422,7 +422,7 @@ jobs:
|
|||||||
- name: Create a different file
|
- name: Create a different file
|
||||||
run: echo "goodbye world" > my-file.txt
|
run: echo "goodbye world" > my-file.txt
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact # NOTE: same artifact name
|
name: my-artifact # NOTE: same artifact name
|
||||||
path: my-file.txt
|
path: my-file.txt
|
||||||
@@ -438,7 +438,7 @@ Any files that contain sensitive information that should not be in the uploaded
|
|||||||
using the `path`:
|
using the `path`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
@@ -470,7 +470,7 @@ If you must preserve permissions, you can `tar` all of your files together befor
|
|||||||
run: tar -cvf my_files.tar /path/to/my/directory
|
run: tar -cvf my_files.tar /path/to/my/directory
|
||||||
|
|
||||||
- name: 'Upload Artifact'
|
- name: 'Upload Artifact'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
path: my_files.tar
|
path: my_files.tar
|
||||||
archive: false
|
archive: false
|
||||||
|
|||||||
Reference in New Issue
Block a user