Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/repro.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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),)
Expand Down
6 changes: 3 additions & 3 deletions contrib/reprobuild/Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
Loading