-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathaction.yml
More file actions
32 lines (32 loc) · 1010 Bytes
/
action.yml
File metadata and controls
32 lines (32 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Archive installed package
inputs:
path:
description: Directory to archive
required: true
name:
description: Artifact name
required: true
runs:
using: composite
steps:
- id: set-archive
shell: bash
run: |
if [ "${RUNNER_OS}" = "Windows" ]; then
echo "archive=${{ inputs.name }}.zip" >> "$GITHUB_OUTPUT"
else
echo "archive=${{ inputs.name }}.tar.gz" >> "$GITHUB_OUTPUT"
fi
- name: Compress directory (unix)
if: runner.os != 'Windows'
shell: bash
run: tar -czvf "${{ steps.set-archive.outputs.archive }}" -C "${{ inputs.path }}" .
- name: Compress directory (windows)
if: runner.os == 'Windows'
shell: pwsh
run: Compress-Archive -Path ${{ inputs.path }} -DestinationPath ${{ steps.set-archive.outputs.archive }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ steps.set-archive.outputs.archive }}