Compare commits

..

No commits in common. "0aad9dab0a9f644485f88d2cadf0caa7ebb34adb" and "f0ad69f4dfb6a053ec90bd23f4918ca643e44b49" have entirely different histories.

6 changed files with 803 additions and 1452 deletions

1
.gitattributes vendored
View file

@ -1 +0,0 @@
* text=auto eol=lf

View file

@ -2,10 +2,12 @@ name: Test
on: on:
push: push:
branches: branches:
- master - v2-preview
paths-ignore: paths-ignore:
- '**.md' - '**.md'
pull_request: pull_request:
branches:
- v2-preview
paths-ignore: paths-ignore:
- '**.md' - '**.md'
@ -16,7 +18,7 @@ jobs:
strategy: strategy:
matrix: matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest] runs-on: [ubuntu-latest, macOS-latest, windows-latest]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }}

View file

@ -1,22 +1,9 @@
# Upload-Artifact v2 # Upload-Artifact v2 Preview
This uploads artifacts from your workflow allowing you to share data between jobs and store data once a workflow is complete. This uploads artifacts from your workflow allowing you to share data between jobs and store data once a workflow is complete.
See also [download-artifact](https://github.com/actions/download-artifact). See also [download-artifact](https://github.com/actions/download-artifact).
# What's new
- Easier upload
- Specify a wildcard pattern
- Specify an individual file
- Specify a directory (previously you were limited to only this option)
- Upload an artifact without providing a name
- Fix for artifact uploads sometimes not working with containers
- Proxy support out of the box
- Port entire action to typescript from a runner plugin so it is easier to collaborate and accept contributions
Refer [here](https://github.com/actions/upload-artifact/tree/releases/v1) for the previous version
# Usage # Usage
See [action.yml](action.yml) See [action.yml](action.yml)
@ -30,7 +17,7 @@ steps:
- run: echo hello > path/to/artifact/world.txt - run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
with: with:
name: my-artifact name: my-artifact
path: path/to/artifact/world.txt path: path/to/artifact/world.txt
@ -39,7 +26,7 @@ steps:
### Upload an Entire Directory ### Upload an Entire Directory
```yaml ```yaml
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
with: with:
name: my-artifact name: my-artifact
path: path/to/artifact/ # or path/to/artifact path: path/to/artifact/ # or path/to/artifact
@ -47,7 +34,7 @@ steps:
### Upload using a Wildcard Pattern: ### Upload using a Wildcard Pattern:
```yaml ```yaml
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
with: with:
name: my-artifact name: my-artifact
path: path/**/[abc]rtifac?/* path: path/**/[abc]rtifac?/*
@ -55,7 +42,7 @@ steps:
For supported wildcards along with behavior and documentation, see [@actions/glob](https://github.com/actions/toolkit/tree/master/packages/glob) which is used internally to search for files. For supported wildcards along with behavior and documentation, see [@actions/glob](https://github.com/actions/toolkit/tree/master/packages/glob) which is used internally to search for files.
Relative and absolute file paths are both allowed. Relative paths are rooted against the current working directory. Paths that begin with a wildcard character should be quoted to avoid being interpreted as YAML aliases. Relative and absolute file paths are both allowed. Relative paths are rooted against the current working directory.
The [@actions/artifact](https://github.com/actions/toolkit/tree/master/packages/artifact) package is also used internally to handle most of the logic around uploading an artifact. There is extra documentation around upload limitations and behavior in the toolkit repo that is worth checking out. The [@actions/artifact](https://github.com/actions/toolkit/tree/master/packages/artifact) package is also used internally to handle most of the logic around uploading an artifact. There is extra documentation around upload limitations and behavior in the toolkit repo that is worth checking out.
@ -64,7 +51,7 @@ The [@actions/artifact](https://github.com/actions/toolkit/tree/master/packages/
To upload artifacts only when the previous step of a job failed, use [`if: failure()`](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#job-status-check-functions): To upload artifacts only when the previous step of a job failed, use [`if: failure()`](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#job-status-check-functions):
```yaml ```yaml
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
if: failure() if: failure()
with: with:
name: my-artifact name: my-artifact
@ -75,7 +62,7 @@ To upload artifacts only when the previous step of a job failed, use [`if: failu
You can upload an artifact without specifying a name You can upload an artifact without specifying a name
```yaml ```yaml
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
with: with:
path: path/to/artifact/world.txt path: path/to/artifact/world.txt
``` ```
@ -88,17 +75,17 @@ Each artifact behaves as a file share. Uploading to the same artifact multiple t
```yaml ```yaml
- run: echo hi > world.txt - run: echo hi > world.txt
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
with: with:
path: world.txt path: world.txt
- run: echo howdy > extra-file.txt - run: echo howdy > extra-file.txt
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
with: with:
path: extra-file.txt path: extra-file.txt
- run: echo hello > world.txt - run: echo hello > world.txt
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2-preview
with: with:
path: world.txt path: world.txt
``` ```
@ -112,7 +99,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@v2 - uses: actions/upload-artifact@v2-preview
with: with:
name: 'Artifacts-V2' name: 'Artifacts-V2'
path: '~/new/**/*' path: '~/new/**/*'
@ -127,7 +114,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@v2 - uses: actions/upload-artifact@v2-preview
with: with:
name: ${{ env.name }}-name name: ${{ env.name }}-name
path: ${{ github.workspace }}/artifact/**/* path: ${{ github.workspace }}/artifact/**/*
@ -137,7 +124,7 @@ Environment variables along with context expressions can also be used for input.
In the top right corner of a workflow run, once the run is over, if you used this action, there will be a `Artifacts` dropdown which you can download items from. Here's a screenshot of what it looks like<br/> In the top right corner of a workflow run, once the run is over, if you used this action, there will be a `Artifacts` dropdown which you can download items from. Here's a screenshot of what it looks like<br/>
<img src="https://user-images.githubusercontent.com/16109154/72556687-20235a80-386d-11ea-9e2a-b534faa77083.png" width="375" height="140"> <img src="https://user-images.githubusercontent.com/16109154/72556687-20235a80-386d-11ea-9e2a-b534faa77083.png" width="375" height="140">
There is a trashcan icon that can be used to delete the artifact. This icon will only appear for users who have write permissions to the repository. There is a trash can icon that can be used to delete the artifact. This icon will only appear for users who have write permissions to the repository.
## Additional Documentation ## Additional Documentation

666
dist/index.js vendored

File diff suppressed because it is too large Load diff

1437
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -29,23 +29,23 @@
}, },
"homepage": "https://github.com/actions/upload-artifact#readme", "homepage": "https://github.com/actions/upload-artifact#readme",
"devDependencies": { "devDependencies": {
"@actions/artifact": "^0.3.1", "@actions/artifact": "^0.2.0",
"@actions/core": "^1.2.3", "@actions/core": "^1.2.3",
"@actions/glob": "^0.1.0", "@actions/glob": "^0.1.0",
"@actions/io": "^1.0.2", "@actions/io": "^1.0.2",
"@types/jest": "^25.2.1", "@types/jest": "^25.1.4",
"@types/node": "^13.11.1", "@types/node": "^12.12.30",
"@typescript-eslint/parser": "^2.27.0", "@typescript-eslint/parser": "^2.23.0",
"@zeit/ncc": "^0.22.1", "@zeit/ncc": "^0.20.5",
"concurrently": "^5.1.0", "concurrently": "^5.1.0",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-plugin-github": "^3.4.1", "eslint-plugin-github": "^3.4.1",
"eslint-plugin-jest": "^23.8.2", "eslint-plugin-jest": "^23.8.2",
"glob": "^7.1.6", "glob": "^7.1.6",
"jest": "^25.3.0", "jest": "^25.1.0",
"jest-circus": "^25.3.0", "jest-circus": "^25.1.0",
"prettier": "^2.0.4", "prettier": "^1.19.1",
"ts-jest": "^25.3.1", "ts-jest": "^25.2.1",
"typescript": "^3.8.3" "typescript": "^3.8.3"
} }
} }