-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve executable permissions in archive
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# File: .github/actions/download-tar/action.yml | ||
name: Download Tar Artifact | ||
description: > | ||
Download and extract a tar artifact that was previously uploaded in the workflow by the upload-tar | ||
action | ||
inputs: | ||
name: | ||
description: Artifact name | ||
path: | ||
description: Destination path | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
name: ${{ inputs.name }} | ||
path: ${{ inputs.path }} | ||
|
||
- run: ${{ github.action_path }}/untar.sh "${{ inputs.name }}" | ||
working-directory: ${{ inputs.path }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
# File: .github/actions/download-tar/untar.sh | ||
set -x | ||
name="$1" | ||
|
||
if [[ "$name" == '' ]]; then | ||
dirs=(*/) | ||
else | ||
dirs=(.) | ||
fi | ||
|
||
for dir in ${dirs[@]}; do | ||
echo "> Extracting: $dir" | ||
pushd "$dir" >/dev/null | ||
tar xvf artifact.tar | ||
rm artifact.tar | ||
popd >/dev/null | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# File: .github/actions/upload-tar/action.yml | ||
name: Upload Tar Artifact | ||
description: Compress files with tar prior to artifacting to keep file privileges. | ||
|
||
inputs: | ||
name: | ||
description: Artifact name | ||
path: | ||
description: A directory path. The contents of that directory will be tarballed and uploaded. | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
|
||
- run: tar cvf artifact.tar * | ||
shell: bash | ||
working-directory: ${{ inputs.path }} | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: ${{ inputs.name }} | ||
path: ${{ inputs.path }}/artifact.tar | ||
overwrite: true | ||
|
||
- run: rm artifact.tar | ||
shell: bash | ||
working-directory: ${{ inputs.path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters