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

Package 5.7.2 for Ubuntu (focal, jammy), re-divide into lib / dev / bin + metapkg, automated ppa:swiftlang/swiftlang deploy #162

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
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
50 changes: 50 additions & 0 deletions .github/workflows/build-ubuntu-debs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build signed src package for Launchpad binary build & PPA distrib
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build-ubuntu-packages:
strategy:
matrix:
os: [{version: ubuntu-20.04, codename: focal}, {version: ubuntu-22.04, codename: jammy}]
runs-on: ${{ matrix.os.version }}
environment: swiftlang-ppa
steps:
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3

- name: Install build dependencies
run: |
sudo apt install -y --no-install-recommends devscripts dpkg-dev dput equivs rsync

- name: Build source package
working-directory: platforms/Linux/DEB/Ubuntu/${{ matrix.os.codename }}
run: |
sudo mkdir -p /output
sudo chown $USER /output
bash ./build_deb.sh -s

- name: Sign source package
working-directory: /output
run: |
debsign -k $DEBSIGN_KEYID swiftlang_*_source.changes
env:
DEBEMAIL: ${{ secrets.DEBEMAIL }}
DEBFULLNAME: ${{ secrets.DEBFULLNAME }}
DEBSIGN_KEYID: ${{secrets.DEBSIGN_KEYID }}

- name: Copy dput configuration in place
working-directory: platforms/Linux/DEB/Ubuntu
run: cp .dput.cf ~/.dput.cf

- name: Upload to Launchpad for binary build
working-directory: /output
run: dput ppa:swiftlang/swiftlang swiftlang_*_source.changes

45 changes: 37 additions & 8 deletions platforms/Linux/DEB/Shared/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,66 @@

set -eux

source_only_pkg=FALSE # build binary deb by default
while getopts ":s" option; do
Copy link
Author

Choose a reason for hiding this comment

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

A -s option was added to optionally build a source package with build_deb.sh (source package's assets would then be signed and uploaded to an external build server to build the binary package in case of the PPA or later perhaps an Ubuntu or Debian distribution intended package).

case $option in
s)
source_only_pkg=TRUE
;;
esac
done

here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# load version definitions
. ${here}/versions.sh

# working in /tmp since docker file sharing makes this very slow to do dirctly on the share
# working in /tmp since docker file sharing makes this very slow to do directly on the share
staging_dir=/tmp/swift-deb-builder
package_dir=${staging_dir}/swiftlang-${debversion}

# clean
rm -rf ${package_dir} && mkdir -p ${package_dir}

# copy control files to pakcage build directory
cp -r ${here}/debian ${package_dir}/
cp -r ${package_dir}/debian/control.in ${package_dir}/debian/control
# use rsync to copy control, rules, patches files to package build directory,
# including relative symlink targets
rsync --archive --copy-links ${here}/debian ${package_dir}/
cp ${package_dir}/debian/control.in ${package_dir}/debian/control

# build the source package
${here}/build_source_package.sh ${staging_dir}

# install the build dependencies
cd ${staging_dir}
mk-build-deps --install ${package_dir}/debian/control.in --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends'

if [ -f /.dockerenv ]; then
Copy link
Author

Choose a reason for hiding this comment

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

This conditional was added since I noticed as part of building in Jammy and Focal LXC containers with non-privileged accounts that it was necessary (and conversely plainly adding sudo would break the Docker based build).

root_cmd="" # no --root-cmd assumed needed when executing in container
else
root_cmd="--root-cmd=sudo"
fi

mk-build-deps --install ${package_dir}/debian/control ${root_cmd} --remove --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends'


# build the installable package
# TODO: add signing key information
cd ${package_dir}
DEB_BUILD_OPTIONS=parallel=64 debuild

if [ "$source_only_pkg" == "TRUE" ]; then
DEB_BUILD_OPTIONS=parallel=64 debuild -uc -us -sa -S
else
DEB_BUILD_OPTIONS=parallel=64 debuild
fi

# copy the final packages to /output
cd ${staging_dir}
cp *.deb /output/
cp *.ddeb /output/

if [ "$source_only_pkg" == "FALSE" ]; then
cp *.deb /output/
cp *.ddeb /output/
fi

cp *.dsc /output/
cp *.tar.* /output/
cp *.changes /output/
cp *.buildinfo /output/
6 changes: 3 additions & 3 deletions platforms/Linux/DEB/Shared/versions.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

debversion=5.7.1
debversion=5.7.2

swift_version=5.7.1-RELEASE
swift_version=5.7.2-RELEASE
icu_version=65-1
yams_version=4.0.2
yams_version=5.0.1
swift_argument_parser_version=1.0.3
swift_crypto_version=1.1.5
ninja_version=1.10.2
Expand Down
7 changes: 7 additions & 0 deletions platforms/Linux/DEB/Ubuntu/.dput.cf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[swiftlang]
Copy link
Author

Choose a reason for hiding this comment

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

This is a config file needed for uploading the (signed) source package to Launchpad.

fqdn = ppa.launchpad.net
method = sftp
incoming = ~swiftlang/ubuntu/swiftlang/
login = swiftlang-uploader
allow_unsigned_uploads = 0

1 change: 0 additions & 1 deletion platforms/Linux/DEB/Ubuntu/bionic/README.md

This file was deleted.

6 changes: 6 additions & 0 deletions platforms/Linux/DEB/Ubuntu/focal/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
swiftlang (5.7.2-0~focal5) focal; urgency=medium

* Replaces `swiftlang` + `swiftlang-X.Y.Z` packages with `libswiftlang-X.Y.Z`, `libswiftlang-X.Y.Z-dev`, `swiftlang-X.Y.Z-bin` and meta-package `swiftlang`.

-- Matias Piipari <[email protected]> Tue, 6 Dec 2022 15:53:00 +0200

swiftlang (5.6.0-1) focal; urgency=medium

* Debian packaging introduction for Swift 5.6.
Expand Down
77 changes: 39 additions & 38 deletions platforms/Linux/DEB/Ubuntu/focal/debian/control.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,46 @@ Section: devel
Priority: optional
Maintainer: Swift Maintainers <[email protected]>
Build-Depends: debhelper-compat (= 12), devscripts,
clang, cmake, git, icu-devtools, ninja-build, pkg-config,
libcurl4-openssl-dev, libedit-dev, libicu-dev, libncurses5-dev,
libpython3-dev, libsqlite3-dev, libxml2-dev,
python, python-six, python2-dev, python3-six, python3-distutils, python3-psutil,
rsync, swig, systemtap-sdt-dev, tzdata, unzip, uuid-dev
Standards-Version: 4.4.1
clang, cmake, git, icu-devtools, ninja-build, pkg-config,
libcurl4-openssl-dev, libedit-dev, libicu-dev, libncurses5-dev,
libpython3-dev, libsqlite3-dev, libxml2-dev,
python, python-six, python2-dev, python3-six, python3-distutils, python3-psutil,
rsync, swig, systemtap-sdt-dev, tzdata, unzip, uuid-dev
Standards-Version: 4.6.1
Homepage: https://www.swift.org

Package: swiftlang
Architecture: all
Depends: swiftlang-x.y.z, ${misc:Depends}
Description: Swift programming language
Swift is a general-purpose programming language built using
a modern approach to safety, performance, and software design
patterns.
.
The goal of the Swift project is to create the best available
language for uses ranging from systems programming, to mobile
and desktop apps, scaling up to cloud services. Most
importantly, Swift is designed to make writing and maintaining
correct programs easier for the developer.
.
This package contains the convenience symlinks for the latest
version of Swift.
Package: libswiftlang-x.y.z
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Runtime libraries for the Swift programming language

Package: libswiftlang-x.y.z-dev
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends},
libc6-dev, libcurl4-openssl-dev, libgcc-9-dev, libstdc++-9-dev, libxml2-dev,
libz3-dev, uuid-dev, zlib1g-dev
Description: Headers, static libraries for the Swift programming language

Package: swiftlang-x.y.z
Architecture: amd64 arm64
Package: swiftlang-x.y.z-bin
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends},
libc6-dev, libcurl4-openssl-dev, libgcc-9-dev, libstdc++-9-dev, libxml2-dev,
libz3-dev, uuid-dev, zlib1g-dev,
binutils, git, pkg-config, tzdata, unzip
python3
Description: Swift programming language, release x.y.z
Swift is a general-purpose programming language built using
a modern approach to safety, performance, and software design
patterns.
.
The goal of the Swift project is to create the best available
language for uses ranging from systems programming, to mobile
and desktop apps, scaling up to cloud services. Most
importantly, Swift is designed to make writing and maintaining
correct programs easier for the developer.
libswiftlang-x.y.z, libswiftlang-x.y.z-dev,
binutils, git, pkg-config, tzdata, unzip,
python3
Description: Swift programming language
Swift is a general-purpose programming language built using
Copy link
Author

Choose a reason for hiding this comment

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

I wasn't very sure if perhaps this longer schpiel about Swift should be repeated in the different packages, or should be there only in the meta-package? If the package division in this style is something you want to keep, the descriptions to the individual packages probably needs revisiting still, either way.

a modern approach to safety, performance, and software design
patterns.
The goal of the Swift project is to create the best available
language for uses ranging from systems programming, to mobile
and desktop apps, scaling up to cloud services. Most
importantly, Swift is designed to make writing and maintaining
correct programs easier for the developer.
This package contains the convenience symlinks for the latest
version of Swift.

Package: swiftlang
Architecture: any
Depends:
libswiftlang-x.y.z, libswiftlang-x.y.z-dev, swiftlang-x.y.z-bin
Description: Virtual package that provides the most recent version of the Swift programming language

This file was deleted.

This file was deleted.

Loading