File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 13
13
fetch-depth : 0
14
14
15
15
- run : make binaries
16
+ env :
17
+ CHECKSUM : ' 1'
16
18
17
19
- uses : actions/upload-artifact@v4
18
20
with :
Original file line number Diff line number Diff line change 13
13
- uses : actions/checkout@v4
14
14
15
15
- run : make binaries
16
+ env :
17
+ CHECKSUM : ' 1'
16
18
17
19
- uses : actions/upload-artifact@v4
18
20
with :
@@ -38,11 +40,24 @@ jobs:
38
40
39
41
const currentRelease = context.ref.split('/')[2];
40
42
43
+ let body = `## Security\n\n`
44
+ + `Binaries have been produced by the [Release workflow](https://github.com/${owner}/${repo}/actions/workflows/release.yml)`
45
+ + ` without human intervention.\n\n`
46
+ + `SHA256 checksums:\n`;
47
+
48
+ for (const name of await fs.readdir('./binaries/')) {
49
+ if (name.endsWith('.sha256sum')) {
50
+ const parts = (await fs.readFile(`./binaries/${name}`, 'utf-8')).slice(0, -1).split(' ');
51
+ body += `* ${parts[2]} ${parts[0]}\n`;
52
+ }
53
+ }
54
+
41
55
const res = await github.rest.repos.createRelease({
42
56
owner,
43
57
repo,
44
58
tag_name: currentRelease,
45
59
name: currentRelease,
60
+ body,
46
61
});
47
62
const release_id = res.data.id;
48
63
Original file line number Diff line number Diff line change 1
1
BINARY_NAME = mediamtx
2
2
3
+ ifeq ($(CHECKSUM ) ,1)
4
+ define DOCKERFILE_CHECKSUM
5
+ RUN cd /s/binaries; for f in *; do sha256sum $$f > $$f.sha256sum; done
6
+ endef
7
+ endif
8
+
3
9
define DOCKERFILE_BINARIES
4
10
FROM $(BASE_IMAGE ) AS build-base
5
11
RUN apk add --no-cache zip make git tar
@@ -56,6 +62,7 @@ COPY --from=build-darwin-arm64 /s/binaries /s/binaries
56
62
COPY --from=build-linux-armv6 /s/binaries /s/binaries
57
63
COPY --from=build-linux-armv7 /s/binaries /s/binaries
58
64
COPY --from=build-linux-arm64 /s/binaries /s/binaries
65
+ $(DOCKERFILE_CHECKSUM )
59
66
endef
60
67
export DOCKERFILE_BINARIES
61
68
You can’t perform that action at this time.
0 commit comments