|
| 1 | +--- |
| 2 | +# https://docs.corelightning.org/docs/repro |
| 3 | +name: Repro Build Nightly |
| 4 | +on: |
| 5 | + # 05:00 Berlin, 03:00 UTC, 23:00 New York, 20:00 Los Angeles |
| 6 | + schedule: |
| 7 | + - cron: "0 3 * * *" |
| 8 | +jobs: |
| 9 | + ubuntu-noble: |
| 10 | + name: Ubuntu Noble Repro build |
| 11 | + runs-on: ubuntu-22.04 |
| 12 | + steps: |
| 13 | + - name: Git checkout |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Build environment setup |
| 17 | + run: | |
| 18 | + echo "Building base image for noble" |
| 19 | + docker run --rm -v $(pwd):/build ubuntu:noble bash -c "apt-get update && apt-get install -y debootstrap && debootstrap noble /build/noble" |
| 20 | + tar -C noble -c . | docker import - noble |
| 21 | +
|
| 22 | + - name: Builder image setup |
| 23 | + run: docker build -t cl-repro-noble - < contrib/reprobuild/Dockerfile.noble |
| 24 | + |
| 25 | + - name: Create release directory |
| 26 | + run: mkdir $GITHUB_WORKSPACE/release |
| 27 | + |
| 28 | + - name: Build using the builder image, storing version and Git state |
| 29 | + run: | |
| 30 | + # Perform the repro build. |
| 31 | + docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-noble |
| 32 | +
|
| 33 | + # Commit the image in order to inspect the build later. |
| 34 | + docker commit cl-build cl-release |
| 35 | +
|
| 36 | + # Inspect the version. |
| 37 | + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "make version > /repo/release/version.txt" |
| 38 | +
|
| 39 | + # Inspect the Git tree state. |
| 40 | + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "\ |
| 41 | + git --no-pager status > /repo/release/git.log && \ |
| 42 | + git --no-pager diff >> /repo/release/git.log" |
| 43 | +
|
| 44 | + # Change permissions on the release files for access by build environment. |
| 45 | + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro-noble chmod -R 777 /repo/release |
| 46 | +
|
| 47 | + - name: Assert clean version and release |
| 48 | + run: | |
| 49 | + echo 'Version:' |
| 50 | + cat release/version.txt |
| 51 | + echo -e |
| 52 | +
|
| 53 | + releasefile=$(ls release/clightning-*) |
| 54 | + echo 'Release file:' |
| 55 | + ls -al release/clightning-* |
| 56 | + echo -e |
| 57 | +
|
| 58 | + if [ -n "$(cat release/version.txt | sed -n '/-modded/p')" ] || \ |
| 59 | + [ -n "$(echo $releasefile | sed -n '/-modded/p')" ] |
| 60 | + then |
| 61 | + echo "Git Status and Diff:" |
| 62 | + cat release/git.log |
| 63 | + echo -e |
| 64 | +
|
| 65 | + echo 'Error: release modded / dirty tree.' |
| 66 | + exit 1 |
| 67 | + else |
| 68 | + echo 'Success! Clean release.' |
| 69 | + fi |
0 commit comments