2023-12-20 09:17:49 -05:00
|
|
|
name: Download artifact
|
|
|
|
description: Download and decrypt an artifact.
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
name:
|
|
|
|
description: 'The name of the artifact.'
|
|
|
|
required: true
|
|
|
|
path:
|
|
|
|
description: 'Download to a specified path.'
|
|
|
|
required: false
|
|
|
|
default: ./
|
2023-12-21 13:28:18 -05:00
|
|
|
encryptionSecret:
|
2023-12-20 09:17:49 -05:00
|
|
|
description: 'The secret to use for decrypting the artifact.'
|
|
|
|
required: true
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2024-05-08 04:34:10 -04:00
|
|
|
- name: Install 7zip
|
2023-12-20 09:17:49 -05:00
|
|
|
uses: ./.github/actions/setup_bazel_nix
|
|
|
|
with:
|
|
|
|
nixTools: |
|
2024-05-08 04:34:10 -04:00
|
|
|
_7zz
|
2023-12-20 09:17:49 -05:00
|
|
|
|
|
|
|
- name: Create temporary directory
|
|
|
|
id: tempdir
|
|
|
|
shell: bash
|
|
|
|
run: echo "directory=$(mktemp -d)" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
- name: Download the artifact
|
2024-05-08 08:33:35 -04:00
|
|
|
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
|
2023-12-20 09:17:49 -05:00
|
|
|
with:
|
|
|
|
name: ${{ inputs.name }}
|
|
|
|
path: ${{ steps.tempdir.outputs.directory }}
|
|
|
|
|
|
|
|
- name: Decrypt and unzip archive
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-12-21 13:28:18 -05:00
|
|
|
mkdir -p ${{ inputs.path }}
|
2024-05-23 03:24:15 -04:00
|
|
|
7zz x -p'${{ inputs.encryptionSecret }}' -bso0 -bsp0 -t7z -o"${{ inputs.path }}" ${{ steps.tempdir.outputs.directory }}/archive.7z
|