crystal-lang / distribution-scripts

40 stars 24 forks source link

Bintray publishing scripts #72

Closed bcardiff closed 4 years ago

bcardiff commented 4 years ago

This PR handles the publication of deb and rpm packages to Bintray.

The process to transform linux 64 and 32 bits .tar.gz to .deb and .rpm packages via fpm is duplicated from the ./linux directory. Eventually the one in ./linux will go away narrowing it's resposibility to produce the .tar.gz only.

The bintray packages are published in three channels: stable, unstable, nightly. There are helper scripts in ./bintray/publish-<channel>.sh to download .tar.gz, build deb/rpm and publish them directly to bintray.

The deb repository will be registered as

deb https://dl.bintray.com/crystal/deb all stable
deb https://dl.bintray.com/crystal/deb all unstable
deb https://dl.bintray.com/crystal/deb all nightly

There are no distro distinctions needed.

The rpm repository will be registered as

[crystal]
name=Crystal
baseurl=https://dl.bintray.com/crystal/rpm/{DISTRO}/x86_64/{CHANNEL}
gpgcheck=0
repo_gpgcheck=1
gpgkey=http://bintray.com/user/downloadSubjectPublicKey?username=bintray

where DISTRO=el6 | all and CHANNEL=stable | unstable | nightly to expose properly dependencies to CentOS 6/7/8 and Fedora. Only CentOS 6 is the one that needs a different expression of dependencies.

There are some scripts I used to test the packages in different distros via docker images: ./bintray/test-install.sh

The packages are uploaded signed with the same distribution key as before, but the metadata of the repository will be handled by bintray itself. All these settings are documented and can be recreated by the Makefile.

To handle the signing in an automated way the ./bintray/sign.sh will create some docker containers with the crystal distribution signing key. This is based on the existing work of the crystal-dist repo which will eventually stop been used to publish packages.

After this is merged the crystal repo will be updated to publish nightly packages to these repositories.

The ./bintray/scripts/install.sh script will help users to do fresh installs and upgrades to specific crystal version packages. This script will be advertised with a nicer url but should be kept here since it is tested with the test-install.sh script already mentioned.