diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..f43f4fdb --- /dev/null +++ b/RELEASE.md @@ -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 `. 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 ` + +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 + diff --git a/VERSION_BUMP.md b/VERSION_BUMP.md deleted file mode 100644 index 7a4c5bf5..00000000 --- a/VERSION_BUMP.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Version bump -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 -* perform merge into master of that branch -* add a tag of the release version -* `git push --tags origin master` -* create a release in github with the tag you've just created - -Pushing to master will trigger a build/release, and will push the artifacts to the new release as assets. - -The reason for this is related to limitations in the way that pyci uploads the binaries to github. - -# - -TBD - Continue with the flow of wrapping the artifacts with rpm/deb, copying the files to packages-for-q, and updating the web site. diff --git a/dist/create-rpm b/dist/create-rpm index 8c247f99..697f1122 100755 --- a/dist/create-rpm +++ b/dist/create-rpm @@ -5,6 +5,8 @@ # # +set -o pipefail + if [ $# -ne 2 ]; then echo 'create-rpm ' @@ -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 diff --git a/dist/q-text-as-data.spec.template b/dist/q-text-as-data.spec.template index 8512aa2d..2be7cc20 100644 --- a/dist/q-text-as-data.spec.template +++ b/dist/q-text-as-data.spec.template @@ -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 @@ -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 diff --git a/package-release b/package-release index f27186fa..1aa1515b 100755 --- a/package-release +++ b/package-release @@ -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 + diff --git a/upload-release b/upload-release new file mode 100755 index 00000000..a3909393 --- /dev/null +++ b/upload-release @@ -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) " + 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 + + +