This workflow file publishes new action releases to the immutable action package of the same name as this repo.
This is part of the Immutable Actions project which is not yet fully released to the public. First party actions like this one are part of our initial testing of this feature.
* Create devcontainer for codespaces
* Use node 16 for devcontainer and CI
* Fix node version incompatibility error
* Remove caching
* Add npm build to check-dist
* Remove new caching
* use npm install
* Test node 14
* Update check dist with node 16
* Use node 18.x for check-dist
* Npm install vs CI
* Update package.json scripts
* test
* Remove caching
* npm run test
* testing
* test
* test
* One more test
* Test
* test
* Update everything
* use vercel
* Test
* Update index.js
* Test
* Remove codeql warnings
* Use NPM CI vs install
* Small tweaks to existing workflows
* Some `README.md` whitespace and tweaks
* Fix link and title to GitHub documentation page on `README.md`
* Update link to `actions/toolkit` documentation
* De-quote some YAML blocks/examples in `README.md`
* Create check-dist.yml
* steps.if still needs ${{ }} when the expr has operators
* single quotes?
* npm install
* mess with index.js
* add if failure()
* Copy the correct version back in from the artifact
* Update .github/workflows/check-dist.yml
Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
* formatting & language
* npm ci
Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
Given the way that the two descriptions were written it was confusing about which example was being discussed (see specifically "In the above example in the previous version).
description:Make a suggestion to improve the documentation!
labels:['documentation']
title:'[docs]'
body:
- type:markdown
attributes:
value:|
❗ This is only for documentation updates for files in this repo, ie: `README.md`.
If you want to suggest changes for the [GitHub Docs](https://docs.github.com/), please [open an issue there](https://github.com/github/docs/issues/new/choose).
- type:textarea
id:affected
attributes:
label:What files would you like to change?
description:|
Please provide permalinks to the specified files and line numbers.
validations:
required:true
- type:textarea
id:suggested
attributes:
label:What are your suggested changes?
description:|
Give as much detail as you can to help us understand the changes you want to see.
# Test end-to-end by uploading two artifacts and then downloading them
- name:Test
run:npm run test
# Test end-to-end by uploading a few artifacts and then downloading them
- name:Create artifact files
run:|
mkdir -p path/to/dir-1
mkdir -p path/to/dir-2
mkdir -p path/to/dir-3
mkdir -p path/to/dir-3
mkdir -p symlink/
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
echo "Hello from a symlinked file" > symlink/original.txt
ln -s $(pwd)/symlink/original.txt symlink/abs.txt
ln -s original.txt symlink/rel.txt
shell:bash
# 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
# Verify artifacts. Switch to download-artifact@v2 once it's out of preview
- name:'Upload symlinked artifact'
uses:./
with:
name:'Symlinked-Artifact-${{ matrix.runs-on }}'
path:|
symlink/abs.txt
symlink/rel.txt
# Download Artifact #1 and verify the correctness of the content
- name:'Download artifact #1'
uses:actions/download-artifact@v1
uses:actions/download-artifact@v4
with:
name:'Artifact-A'
name:'Artifact-A-${{ matrix.runs-on }}'
path:some/new/path
- name:'Verify Artifact #1'
@ -109,9 +114,9 @@ jobs:
# Download Artifact #2 and verify the correctness of the content
- name:'Download artifact #2'
uses:actions/download-artifact@v1
uses:actions/download-artifact@v4
with:
name:'artifact'
name:'Artifact-Wildcard-${{ matrix.runs-on }}'
path:some/other/path
- name:'Verify Artifact #2'
@ -127,32 +132,12 @@ jobs:
Write-Error "File contents of downloaded artifacts are incorrect"
}
shell:pwsh
# Download Artifact #3 and verify the correctness of the content
- name:'Download artifact #3'
uses:actions/download-artifact@v1
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@v1
uses:actions/download-artifact@v4
with:
name:'Multi-Path-Artifact'
name:'Multi-Path-Artifact-${{ matrix.runs-on }}'
path:multi/artifact
- name:'Verify Artifact #4'
@ -168,3 +153,140 @@ jobs:
Write-Error "File contents of downloaded artifacts are incorrect"
}
shell:pwsh
- name:'Download symlinked artifact'
uses:actions/download-artifact@v4
with:
name:'Symlinked-Artifact-${{ matrix.runs-on }}'
path:from/symlink
- name:'Verify symlinked artifact'
run:|
$abs = "from/symlink/abs.txt"
if(!(Test-Path -path $abs))
{
Write-Error "Expected file does not exist"
}
if(!((Get-Content $abs) -ceq "Hello from a symlinked file"))
{
Write-Error "File contents of downloaded artifact are incorrect"
}
$rel = "from/symlink/rel.txt"
if(!(Test-Path -path $rel))
{
Write-Error "Expected file does not exist"
}
if(!((Get-Content $rel) -ceq "Hello from a symlinked file"))
{
Write-Error "File contents of downloaded artifact are incorrect"
}
shell:pwsh
- name:'Alter file 1 content'
run:|
echo "This file has changed" > path/to/dir-1/file1.txt
# Replace the contents of Artifact #1
- name:'Overwrite artifact #1'
uses:./
with:
name:'Artifact-A-${{ matrix.runs-on }}'
path:path/to/dir-1/file1.txt
overwrite:true
# Download replaced Artifact #1 and verify the correctness of the content
- name:'Download artifact #1 again'
uses:actions/download-artifact@v4
with:
name:'Artifact-A-${{ matrix.runs-on }}'
path:overwrite/some/new/path
- name:'Verify Artifact #1 again'
run:|
$file = "overwrite/some/new/path/file1.txt"
if(!(Test-Path -path $file))
{
Write-Error "Expected file does not exist"
}
if(!((Get-Content $file) -ceq "This file has changed"))
{
Write-Error "File contents of downloaded artifact are incorrect"
}
shell:pwsh
merge:
name:Merge
needs:build
runs-on:ubuntu-latest
steps:
- name:Checkout
uses:actions/checkout@v4
# Merge all artifacts from previous jobs
- name:Merge all artifacts in run
uses:./merge/
with:
# our matrix produces artifacts with the same file, this prevents "stomping" on each other, also makes it
# easier to identify each of the merged artifacts
separate-directories:true
- name:'Download merged artifacts'
uses:actions/download-artifact@v4
with:
name:merged-artifacts
path:all-merged-artifacts
- name:'Check merged artifact has directories for each artifact'
run:|
$artifacts = @(
"Artifact-A-ubuntu-latest",
"Artifact-A-macos-latest",
"Artifact-A-windows-latest",
"Artifact-Wildcard-ubuntu-latest",
"Artifact-Wildcard-macos-latest",
"Artifact-Wildcard-windows-latest",
"Multi-Path-Artifact-ubuntu-latest",
"Multi-Path-Artifact-macos-latest",
"Multi-Path-Artifact-windows-latest"
)
foreach ($artifact in $artifacts) {
$path = "all-merged-artifacts/$artifact"
if (!(Test-Path $path)) {
Write-Error "$path does not exist."
}
}
shell:pwsh
# Merge Artifact-A-* from previous jobs
- name:Merge all Artifact-A
uses:./merge/
with:
name:Merged-Artifact-As
pattern:'Artifact-A-*'
separate-directories:true
# Download merged artifacts and verify the correctness of the content
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Copyright 2019 GitHub
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices:[]
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.