forked from lando/core
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (75 loc) · 2.28 KB
/
generate-checksums.yml
File metadata and controls
77 lines (75 loc) · 2.28 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Generate Checksums
on:
workflow_call:
inputs:
download-name:
default:
description: The artifact name to download for checksumming
required: false
type: string
download-pattern:
default:
description: The artifact pattern to download for checksumming
required: false
type: string
depth:
default: "1"
description: The depth to search for files to checksum
required: false
type: string
flatten:
default: false
description: Whether to flatten all downloaded artifacts
required: false
type: boolean
output:
default: sha256sum.txt
description: The name of the checksum file
required: false
type: string
show:
default: true
description: Whether to print the checksums in the action
required: false
type: boolean
upload-name:
default: checksums-${{ github.sha }}
description: The artifact name to upload
required: false
type: string
jobs:
generate-checksums:
runs-on: ubuntu-24.04
env:
TERM: xterm
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Ensure path
run: mkdir -p /tmp/checksums/${{ github.sha }}
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: ${{ inputs.download-name }}
path: /tmp/checksums/${{ github.sha }}
pattern: ${{ inputs.download-pattern }}
merge-multiple: ${{ inputs.flatten }}
- name: Verify files
run: |
echo "::group::Organized checksummed files"
ls -lsa /tmp/checksums/${{ github.sha }}
echo "::endgroup::"
- name: Checksum files
run: |
cd /tmp/checksums/${{ github.sha }}
bash ${{ github.workspace }}/scripts/generate-checksums.sh \
--depth=${{ inputs.depth }} \
--output=/tmp/${{ inputs.output }} \
${{ inputs.show == true && '--show' || ''}}
- name: Upload checksums
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.upload-name }}
path: /tmp/${{ inputs.output }}
if-no-files-found: error
retention-days: 1