diff --git a/.github/workflows/repro.yml b/.github/workflows/repro.yml new file mode 100644 index 000000000000..f21dbcb6cf20 --- /dev/null +++ b/.github/workflows/repro.yml @@ -0,0 +1,78 @@ +--- +# https://docs.corelightning.org/docs/repro +name: Repro Build Nightly +on: + # 05:00 Berlin, 03:00 UTC, 23:00 New York, 20:00 Los Angeles + schedule: + - cron: "0 3 * * *" + workflow_dispatch: + +jobs: + ubuntu: + name: "Ubuntu repro build: ${{ matrix.version }}" + runs-on: ubuntu-22.04 + strategy: + fail-fast: false # Let each build finish. + matrix: + version: ['focal', 'jammy', 'noble'] + steps: + - name: Git checkout + uses: actions/checkout@v4 + + - name: Build environment setup + run: | + echo "Building base image for ${{ matrix.version }}" + sudo docker run --rm -v $(pwd):/build ubuntu:${{ matrix.version }} bash -c "\ + apt-get update && \ + apt-get install -y debootstrap && \ + debootstrap ${{ matrix.version }} /build/${{ matrix.version }}" + sudo tar -C ${{ matrix.version }} -c . | docker import - ${{ matrix.version }} + + - name: Builder image setup + run: docker build -t cl-repro-${{ matrix.version }} - < contrib/reprobuild/Dockerfile.${{ matrix.version }} + + - name: Build using the builder image and store Git state + run: | + # Create release directory. + mkdir $GITHUB_WORKSPACE/release + + # Perform the repro build. + docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-${{ matrix.version }} + + # Commit the image in order to inspect the build later. + docker commit cl-build cl-release + + # Inspect the version. + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "make version > /repo/release/version.txt" + + # Inspect the Git tree state. + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "\ + git --no-pager status > /repo/release/git.log && \ + git --no-pager diff >> /repo/release/git.log" + + # Change permissions on the release files for access by the runner environment. + sudo chown -R runner $GITHUB_WORKSPACE/release + + - name: Assert clean version and release + run: | + echo 'Version:' + cat release/version.txt + echo -e + + releasefile=$(ls release/clightning-*) + echo 'Release file:' + ls -al release/clightning-* + echo -e + + if [ -n "$(cat release/version.txt | sed -n '/-modded/p')" ] || \ + [ -n "$(echo $releasefile | sed -n '/-modded/p')" ] + then + echo "Git Status and Diff:" + cat release/git.log + echo -e + + echo 'Error: release modded / dirty tree.' + exit 1 + else + echo 'Success! Clean release.' + fi diff --git a/Makefile b/Makefile index f835842c99ee..80b61324dc24 100644 --- a/Makefile +++ b/Makefile @@ -899,8 +899,11 @@ installcheck: all-programs fi @rm -rf testinstall || true +version: + @echo ${VERSION} + .PHONY: installdirs install-program install-data install uninstall \ - installcheck ncc bin-tarball show-flags + installcheck ncc bin-tarball show-flags version # Make a tarball of opt/clightning/, optionally with label for distribution. ifneq ($(VERSION),) diff --git a/contrib/reprobuild/Dockerfile.focal b/contrib/reprobuild/Dockerfile.focal index ea0d85516a90..5e951a88a726 100644 --- a/contrib/reprobuild/Dockerfile.focal +++ b/contrib/reprobuild/Dockerfile.focal @@ -44,12 +44,12 @@ RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv && \ libsqlite3-dev \ libssl-dev \ zlib1g-dev && \ - pyenv install 3.8.0 && \ - pyenv global 3.8.0 + pyenv install 3.10.0 && \ + pyenv global 3.10.0 RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py \ - && pip install poetry mako grpcio-tools + && pip install poetry mako grpcio-tools==1.62.2 RUN wget https://sh.rustup.rs -O rustup-install.sh && \ bash rustup-install.sh --default-toolchain none --quiet -y && \