Skip to content

Commit

Permalink
Release Cycle (harelba#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
harelba authored Sep 19, 2020
1 parent 9b492b8 commit b4aedcf
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 21 deletions.
27 changes: 27 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# Releasing a new version
Currently, there are some manual steps needed in order to release a new version:

* Make sure that you're in a branch
* Change the version in the following three files: `bin/q.py`, `setup.py` and `do-manual-release.sh` and commit them to the branch
* Push the commit to the branch/PR
* perform merge into master of that branch from the github UI
* create a new release with a new tag that has the same name as the new version (x.y.z)

The merge will trigger a build/release, and will push the artifacts to the new release as assets.

Now, create the relevant rpm and deb packages:

* Run `./package-release <tag> <version>`. In most cases, both will be the same.
* This will download all the released artifacts for the release into `./packages/`, and will create an rpm and a deb
* Test that the two new artifacts (inside `./packages/`)
* Run `./upload-release <tag> <version>`

The rpm and deb will be added to the assets of the release


Update the website to match the new version.

# Requirements
Requires a logged in github-cli (`gh`) to work

18 changes: 0 additions & 18 deletions VERSION_BUMP.md

This file was deleted.

10 changes: 8 additions & 2 deletions dist/create-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#
#

set -o pipefail

if [ $# -ne 2 ];
then
echo 'create-rpm <version> <based_on_tag>'
Expand Down Expand Up @@ -45,8 +47,12 @@ mkdir -p ${rpm_build_area}/SOURCES
pushd ${rpm_build_area}/SOURCES >/dev/null
tar xvzf ./q.tar.gz --strip-components=1
rm -vf ./q.tar.gz
curl -f -o ./bin/q -L -R "https://github.com/harelba/packages-for-q/raw/master/single-binary/x86_64/${VERSION}/q"
chmod +x ./bin/q

mkdir ${rpm_build_area}/packages
cp /q/packages/q-x86_64-Linux ${rpm_build_area}/packages/q-x86_64-Linux

# Expecting the binaries to exist in /packages/

popd >/dev/null
find ${rpm_build_area}/ -ls

Expand Down
4 changes: 3 additions & 1 deletion dist/q-text-as-data.spec.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ q allows to perform SQL-like statements on tabular text data.
cd %{_topdir}/BUILD
cp -vrf %{_topdir}/SOURCES/* %{_topdir}/BUILD/
chmod -Rf a+rX,u+w,g-w,o-w %{_topdir}/BUILD/
mkdir -p %{_topdir}/BUILD/packages/
cp -vfr /q/packages/* %{_topdir}/BUILD/packages/

%build
cd %{_topdir}/BUILD
Expand All @@ -29,7 +31,7 @@ ronn doc/USAGE.markdown
rm -vrf ${RPM_BUILD_ROOT}/
install -d -m 0755 ${RPM_BUILD_ROOT}%{_bindir}
install -d -m 0755 ${RPM_BUILD_ROOT}%{_datadir}/q-text-as-data
install -Dm 0644 bin/q ${RPM_BUILD_ROOT}%{_datadir}/q-text-as-data/
install -Dm 0644 ./packages/q-x86_64-Linux ${RPM_BUILD_ROOT}%{_datadir}/q-text-as-data/q
ln -s %{_datadir}/q-text-as-data/q ${RPM_BUILD_ROOT}%{_bindir}/q
install -d -m 0755 ${RPM_BUILD_ROOT}%{_mandir}/man1/
install -m 0644 doc/USAGE ${RPM_BUILD_ROOT}%{_mandir}/man1/q.1
Expand Down
7 changes: 7 additions & 0 deletions package-release
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@ rm -rvf ${base_folder}/packages
mkdir -p ${base_folder}/packages

sleep 1

gh release download $BASED_ON_TAG -p '*' -D ./packages/

chmod +x ./packages/*

docker exec -it ${cid1} /bin/bash -i -c "/q/dist/create-rpm ${VERSION} ${BASED_ON_TAG}"

docker cp ${cid1}:/q/dist/rpm_build_area/RPMS/x86_64/q-text-as-data-${VERSION}-1.el6.x86_64.rpm ${base_folder}/packages/q-text-as-data-${VERSION}-1.x86_64.rpm

docker exec -it ${cid2} /bin/bash -i -c "cd /q/packages && alien ./q-text-as-data-${VERSION}-1.x86_64.rpm"

find ./packages/ -ls

24 changes: 24 additions & 0 deletions upload-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -e

base_folder=$(dirname $0)
pushd ${base_folder} >/dev/null

if [ $# -ne 2 ];
then
echo "Usage: $(dirname $0) <version> <git-tag>"
echo
echo "Note that the git tag must be pushed to github before doing this."
exit 1
fi
VERSION="$1"
BASED_ON_TAG="$2"

echo uploading
gh release upload 2.0.18 ./packages/*.{rpm,deb}

echo done



0 comments on commit b4aedcf

Please sign in to comment.