Skip to content

Commit 05a28ae

Browse files
committed
Preserve executable permissions in archive
1 parent 26b1515 commit 05a28ae

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# File: .github/actions/download-tar/action.yml
2+
name: Download Tar Artifact
3+
description: >
4+
Download and extract a tar artifact that was previously uploaded in the workflow by the upload-tar
5+
action
6+
7+
inputs:
8+
name:
9+
description: Artifact name
10+
path:
11+
description: Destination path
12+
required: false
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- uses: actions/[email protected]
18+
with:
19+
name: ${{ inputs.name }}
20+
path: ${{ inputs.path }}
21+
22+
- run: ${{ github.action_path }}/untar.sh "${{ inputs.name }}"
23+
working-directory: ${{ inputs.path }}
24+
shell: bash
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# File: .github/actions/download-tar/untar.sh
3+
set -x
4+
name="$1"
5+
6+
if [[ "$name" == '' ]]; then
7+
dirs=(*/)
8+
else
9+
dirs=(.)
10+
fi
11+
12+
for dir in ${dirs[@]}; do
13+
echo "> Extracting: $dir"
14+
pushd "$dir" >/dev/null
15+
tar xvf artifact.tar
16+
rm artifact.tar
17+
popd >/dev/null
18+
done
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# File: .github/actions/upload-tar/action.yml
2+
name: Upload Tar Artifact
3+
description: Compress files with tar prior to artifacting to keep file privileges.
4+
5+
inputs:
6+
name:
7+
description: Artifact name
8+
path:
9+
description: A directory path. The contents of that directory will be tarballed and uploaded.
10+
required: true
11+
12+
runs:
13+
using: composite
14+
steps:
15+
16+
- run: tar cvf artifact.tar *
17+
shell: bash
18+
working-directory: ${{ inputs.path }}
19+
20+
- uses: actions/[email protected]
21+
with:
22+
name: ${{ inputs.name }}
23+
path: ${{ inputs.path }}/artifact.tar
24+
overwrite: true
25+
26+
- run: rm artifact.tar
27+
shell: bash
28+
working-directory: ${{ inputs.path }}

.github/workflows/haskell.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ jobs:
6767
./build.hs
6868
6969
- name: 🚢 Upload artifact
70-
uses: actions/upload-artifact@v3
70+
uses: ./.github/actions/upload-tar
7171
with:
7272
name: db-server-${{ steps.tag.outputs.value }}-${{ matrix.arch }}-${{ matrix.os }}
7373
path: |
74-
bin/db-server
74+
bin/

0 commit comments

Comments
 (0)