Due to [an issue][1] with the `actions/upload-artifact` action, when binaries are uploaded they lose permission bits and `xattr` properties. Composite actions `upload-tar` and `download-tar` have been added that tarball the artifacts before uploading them to retain those properties. [1]: https://github.com/actions/upload-artifact/issues/38snyk
parent
df07f7ddf6
commit
e1f1872cb7
@ -0,0 +1,25 @@
|
|||||||
|
# This custom action exists because of this issue:
|
||||||
|
# https://github.com/actions/upload-artifact/issues/38
|
||||||
|
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/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.name }}
|
||||||
|
path: ${{ inputs.path }}
|
||||||
|
|
||||||
|
- run: ${{ github.action_path }}/untar.sh "${{ inputs.name }}"
|
||||||
|
working-directory: ${{ inputs.path }}
|
||||||
|
shell: bash
|
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
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
|
@ -0,0 +1,28 @@
|
|||||||
|
# This custom action exists because of this issue:
|
||||||
|
# https://github.com/actions/upload-artifact/issues/38
|
||||||
|
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/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.name }}
|
||||||
|
path: ${{ inputs.path }}/artifact.tar
|
||||||
|
|
||||||
|
- run: rm artifact.tar
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ inputs.path }}
|
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
# Determine the runtime from the target platform provided by Docker Buildx
|
|
||||||
case "$TARGETPLATFORM" in
|
|
||||||
"linux/arm/v7") runtime="linux-musl-arm" ;;
|
|
||||||
"linux/arm64") runtime="linux-musl-arm64" ;;
|
|
||||||
"linux/amd64") runtime="linux-musl-x64" ;;
|
|
||||||
*) echo >&2 "ERROR: Unsupported target platform: $TARGETPLATFORM"; exit 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
path="artifacts/$runtime/"
|
|
||||||
|
|
||||||
mv "$path" publish
|
|
||||||
|
|
||||||
chmod a+rx publish/recyclarr
|
|
Loading…
Reference in new issue