-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (78 loc) · 2.5 KB
/
source-checksums-reusable.yml
File metadata and controls
83 lines (78 loc) · 2.5 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
78
79
80
81
82
83
# Copyright 2025 hrzlgnm
# SPDX-License-Identifier: MIT-0
name: Create and publish source checksum
on:
workflow_call:
inputs:
tagName:
description: The tag name of release to publish for
type: string
required: false
semver:
description: The semver of release to publish for
type: string
required: false
jobs:
tag:
name: Tag
runs-on: ubuntu-slim
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: 🏷️
id: tag
run: |
if [ -n "${{ inputs.tagName }}" ]; then
echo "tag=${{ inputs.tagName }}" >> "$GITHUB_OUTPUT"
elif [ -n "${{ github.event.release.tag_name }}" ]; then
echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
elif [ -n "${{ inputs.semver }}" ]; then
echo "tag=mdns-browser-v${{ inputs.semver }}" >> "$GITHUB_OUTPUT"
else
echo "No tag provided" && exit 1
fi
generate_checksums:
name: 🔢☑️
runs-on: ubuntu-slim
needs:
- tag
strategy:
matrix:
algorithm: [sha256]
steps:
- name: 📥🔢☑️
run: |
set -o errexit
mkdir -p downloads && cd downloads
curl -sLO https://github.com/hrzlgnm/mdns-browser/archive/refs/tags/${{ needs.tag.outputs.tag }}.tar.gz
curl -sLO https://github.com/hrzlgnm/mdns-browser/archive/refs/tags/${{ needs.tag.outputs.tag }}.zip
for file in *; do
if [ -f "$file" ] && [[ "$file" != *.sha* ]]; then
${{ matrix.algorithm }}sum "$file" > "$file.${{ matrix.algorithm }}"
fi
done
- name: 📤
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
with:
name: ${{ matrix.algorithm }}-source-checksums
path: "downloads/*.${{ matrix.algorithm }}"
publish:
name: 📰🔢☑️
runs-on: ubuntu-slim
needs:
- tag
- generate_checksums
steps:
- name: 📥 artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
- name: 📰🔢☑️
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.tag.outputs.tag }}
append_body: true
make_latest: false
generate_release_notes: false
files: |
**/*.sha*