@@ -19,42 +19,48 @@ jobs:
19
19
- name : Git checkout
20
20
uses : actions/checkout@v4
21
21
22
- - name : Build environment setup
22
+ - name : Build environment setup - ${{ matrix.version }}
23
23
run : |
24
24
echo "Building base image for ${{ matrix.version }}"
25
+ echo "STEP=Build environment setup" >> "$GITHUB_ENV"
25
26
sudo docker run --rm -v $(pwd):/build ubuntu:${{ matrix.version }} bash -c "\
26
- apt-get update && \
27
- apt-get install -y debootstrap && \
28
- debootstrap ${{ matrix.version }} /build/${{ matrix.version }}"
27
+ apt-get update && \
28
+ apt-get install -y debootstrap && \
29
+ debootstrap ${{ matrix.version }} /build/${{ matrix.version }}"
29
30
sudo tar -C ${{ matrix.version }} -c . | docker import - ${{ matrix.version }}
30
31
31
- - name : Builder image setup
32
- run : docker build -t cl-repro-${{ matrix.version }} - < contrib/reprobuild/Dockerfile.${{ matrix.version }}
32
+ - name : Builder image setup - ${{ matrix.version }}
33
+ run : |
34
+ echo "STEP=Builder image setup" >> "$GITHUB_ENV"
35
+ docker build -t cl-repro-${{ matrix.version }} - < contrib/reprobuild/Dockerfile.${{ matrix.version }}
33
36
34
- - name : Build using the builder image and store Git state
37
+ - name : Build reproducible image and store Git state - ${{ matrix.version }}
35
38
run : |
39
+ echo "STEP=Build reproducible image and store Git state" >> "$GITHUB_ENV"
40
+
36
41
# Create release directory.
37
42
mkdir $GITHUB_WORKSPACE/release
38
43
39
44
# Perform the repro build.
40
45
docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-${{ matrix.version }}
41
46
42
47
# Commit the image in order to inspect the build later.
43
- docker commit cl-build cl-release
48
+ docker commit cl-build cl-repro
44
49
45
50
# Inspect the version.
46
- docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "make version > /repo/release/version.txt"
51
+ docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro bash -c "make version > /repo/release/version.txt"
47
52
48
53
# Inspect the Git tree state.
49
- docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "\
54
+ docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro bash -c "\
50
55
git --no-pager status > /repo/release/git.log && \
51
56
git --no-pager diff >> /repo/release/git.log"
52
57
53
58
# Change permissions on the release files for access by the runner environment.
54
59
sudo chown -R runner $GITHUB_WORKSPACE/release
55
60
56
- - name : Assert clean version and release
61
+ - name : Assert clean version - ${{ matrix.version }}
57
62
run : |
63
+ echo "STEP=Assert clean version" >> "$GITHUB_ENV"
58
64
echo 'Version:'
59
65
cat release/version.txt
60
66
echo -e
@@ -63,16 +69,45 @@ jobs:
63
69
echo 'Release file:'
64
70
ls -al release/clightning-*
65
71
echo -e
66
-
67
72
if [ -n "$(cat release/version.txt | sed -n '/-modded/p')" ] || \
68
- [ -n "$(echo $releasefile | sed -n '/-modded/p')" ]
69
- then
73
+ [ -n "$(echo $releasefile | sed -n '/-modded/p')" ]; then
70
74
echo "Git Status and Diff:"
71
75
cat release/git.log
72
76
echo -e
73
-
74
77
echo 'Error: release modded / dirty tree.'
75
78
exit 1
76
79
else
77
80
echo 'Success! Clean release.'
78
81
fi
82
+
83
+ - name : Upload release artifact - ${{ matrix.version }}
84
+ uses : actions/upload-artifact@v4
85
+ with :
86
+ name : release-${{ matrix.version }}
87
+ path : release
88
+ retention-days : 3 # Automatically delete after 3 days
89
+
90
+ - name : Send email on failure
91
+ if : ${{ failure() }}
92
+ uses : dawidd6/action-send-mail@v3
93
+ with :
94
+ server_address : smtp.gmail.com
95
+ server_port : 587
96
+ username : ${{ secrets.EMAIL_USERNAME }}
97
+ password : ${{ secrets.EMAIL_PASSWORD }}
98
+ from : ${{ secrets.EMAIL_USERNAME }}
99
+ to : ${{ vars.DISTRIBUTION_LIST }}
100
+ subject : " CI Failure: Step ${{ env.STEP }} failed for distro ${{ matrix.version }}"
101
+ convert_markdown : true
102
+ html_body : |
103
+ <html>
104
+ <body>
105
+ <p>GitHub Workflow ${{ github.workflow }} Failed! For more details, click on the action below.</p>
106
+ <strong>Failure Details:</strong><br/>
107
+ <strong>Event: </strong>${{ github.event_name }}<br/>
108
+ <strong>Job: </strong>${{ github.job }}<br/>
109
+ <strong>Distro: </strong>${{ matrix.version }}<br/>
110
+ <strong>Step: </strong>${{ env.STEP }}<br/>
111
+ <strong>Action: </strong><a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}</a><br/>
112
+ </body>
113
+ </html>
0 commit comments