Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Automation #7797

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
48 changes: 42 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
check:
name: Check
outputs:
version: steps.capture.outputs.version
version: ${{ steps.capture.outputs.version }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this change should be back-ported to the prior commit, where the error was first introduced

runs-on: ubuntu-24.04
steps:
- name: Git checkout
Expand All @@ -37,10 +37,18 @@ jobs:
id: capture
run: echo "version=${VERSION}" >> "$GITHUB_OUTPUT"

release:
name: Release
releases:
name: Releases
needs: check
runs-on: ubuntu-24.04
strategy:
fail-fast: false # Let each build finish.
matrix:
target:
- 'bin-Fedora-28-amd64'
- 'bin-Ubuntu-focal'
- 'bin-Ubuntu-jammy'
- 'bin-Ubuntu-noble'
steps:
- name: Git checkout
uses: actions/checkout@v4
Expand All @@ -54,13 +62,41 @@ jobs:
./configure

- name: Build environment setup
run: contrib/cl-repro.sh
run: |
distribution=$(echo ${{ matrix.target }} | cut -d'-' -f3)
echo "Building base image for ${distribution}"
sudo docker run --rm -v $(pwd):/build ubuntu:${distribution} bash -c "\
apt-get update && \
apt-get install -y debootstrap && \
debootstrap ${distribution} /build/${distribution}"
sudo tar -C ${distribution} -c . | docker import - ${distribution}

# Build Docker image
docker build -t cl-repro-${distribution} - < contrib/reprobuild/Dockerfile.${distribution}
if: contains(matrix.target, 'Ubuntu')

- name: Build release
run: tools/build-release.sh bin-Fedora-28-amd64 bin-Ubuntu
run: tools/build-release.sh ${{ matrix.target }}

- name: Upload release artifacts
- name: Upload target artifacts
uses: actions/upload-artifact@v4
with:
path: release/
name: ${{ matrix.target }}
if-no-files-found: error

artifact:
name: Construct release artifact
needs:
- check
- releases
env:
version: ${{ needs.check.outputs.version }}
runs-on: ubuntu-24.04
steps:
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: c-lightning-${{ env.version }}
pattern: bin-*
delete-merged: true
6 changes: 4 additions & 2 deletions tools/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ for target in $TARGETS; do
docker run --rm=true -w /build $TAG rm -rf /"$VERSION-$platform" /build
echo "Fedora Image Built"
;;
Ubuntu)
for d in focal jammy noble; do
Ubuntu*)
distributions=${platform#Ubuntu-}
[ "$distributions" = "Ubuntu" ] && distributions="focal jammy noble"
for d in $distributions; do
# Capitalize the first letter of distro
D=$(echo "$d" | awk '{print toupper(substr($0,1,1))substr($0,2)}')
echo "Building Ubuntu $D Image"
Expand Down