Skip to content

Commit

Permalink
Handle release candidates in release scripts
Browse files Browse the repository at this point in the history
Refs: #183
  • Loading branch information
orontee committed Sep 14, 2024
1 parent 89f3079 commit b087702
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 44 deletions.
13 changes: 9 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Build DEB package
To build the DEB package *for a given version*, one can build a Docker
image and export the DEB file from that image::

$ VERSION=$(poetry version | cut -d' ' -f 2)
$ VERSION=$(poetry version --short)
$ rm -rf builddir
$ buildah bud -t argos-build:$VERSION --build-arg VERSION=${VERSION} .
$ podman run --rm -v ${PWD}:/opt/argos argos-build:$VERSION bash -c "cp builddir/*.deb /opt/argos"
Expand All @@ -56,7 +56,7 @@ To manually build the DEB package *for current HEAD*, first install
the dependencies listed in the `Containerfile </Containerfile>`_, then run
the following commands::

$ VERSION=$(poetry version | cut -d' ' -f 2)
$ VERSION=$(poetry version --short)
$ mkdir builddir
$ git archive --prefix=builddir/argos-${VERSION}/ --format=tar.gz HEAD | tar xzf -
$ pushd builddir/argos-${VERSION} && debuild -b -tc -us -uc && popd
Expand Down Expand Up @@ -131,8 +131,8 @@ First, update project version with::
Review, complete or update the suggested changes carefully; Make sure
translations and screenshots are up-to-date. Commit, tag and push with::

$ git commit -a -m "Update to version $(poetry version | cut -d' ' -f 2)"
$ git tag $(poetry version | cut -d' ' -f 2)
$ git commit -a -m "Update to version $(poetry version --short)"
$ git tag $(poetry version --short)
$ git push origin; git push --tags origin

Use ``flatpak-builder`` to build locally and Github actions to build a
Expand All @@ -143,6 +143,11 @@ Make a pull request to the technical repository
<https://github.com/flathub/io.github.orontee.Argos>`_ to publish the
release through Flathub.

Finally, run the following command to commit version bump for next
release::

$ poetry run ./scripts/prepare-next-release

Architecture
============

Expand Down
40 changes: 20 additions & 20 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,106 +1,106 @@
argos (1.15.0-rc0) UNRELEASED; urgency=medium
argos (1.15.0a0) UNRELEASED; urgency=medium

* 1.15.0 release candidate.
* 1.15.0a0 release.

-- Matthias Meulien <[email protected]> Sat, 20 Jul 2024 22:07:04 +0200
-- Matthias Meulien <[email protected]> Sat, 14 Sep 2024 23:29:38 +0200

argos (1.14.0-1) UNRELEASED; urgency=medium
argos (1.14.0) RELEASED; urgency=medium

* 1.14.0 release.

-- Matthias Meulien <[email protected]> Sat, 20 Jul 2024 22:07:04 +0200

argos (1.13.0-1) UNRELEASED; urgency=medium
argos (1.13.0-1) RELEASED; urgency=medium

* 1.13.0 release.

-- Matthias Meulien <[email protected]> Sun, 31 Dec 2023 21:30:11 +0100

argos (1.12.0-1) UNRELEASED; urgency=medium
argos (1.12.0-1) RELEASED; urgency=medium

* 1.12.0 release.

-- Matthias Meulien <[email protected]> Thu, 11 May 2023 22:04:27 +0200

argos (1.11.0-1) UNRELEASED; urgency=medium
argos (1.11.0-1) RELEASED; urgency=medium

* 1.11.0 release.

-- Matthias Meulien <[email protected]> Thu, 02 Mar 2023 22:20:00 +0100

argos (1.10.0-1) UNRELEASED; urgency=medium
argos (1.10.0-1) RELEASED; urgency=medium

* 1.10.0 release.

-- Matthias Meulien <[email protected]> Sun, 26 Feb 2023 12:09:00 +0100

argos (1.9.0-1) UNRELEASED; urgency=medium
argos (1.9.0-1) RELEASED; urgency=medium

* 1.9.0 release.

-- Matthias Meulien <[email protected]> Mon, 30 Jan 2023 22:45:00 +0200

argos (1.8.0-1) UNRELEASED; urgency=medium
argos (1.8.0-1) RELEASED; urgency=medium

* 1.8.0 release.

-- Matthias Meulien <[email protected]> Mon, 16 Jan 2023 21:45:00 +0200

argos (1.7.0-1) UNRELEASED; urgency=medium
argos (1.7.0-1) RELEASED; urgency=medium

* 1.7.0 release.

-- Matthias Meulien <[email protected]> Fri, 31 Dec 2022 23:04:00 +0200

argos (1.6.0-1) UNRELEASED; urgency=medium
argos (1.6.0-1) RELEASED; urgency=medium

* 1.6.0 release.

-- Matthias Meulien <[email protected]> Mon, 12 Dec 2022 20:33:00 +0200

argos (1.5.0-1) UNRELEASED; urgency=medium
argos (1.5.0-1) RELEASED; urgency=medium

* 1.5.0 release.

-- Matthias Meulien <[email protected]> Mon, 05 Dec 2022 08:08:28 +0200

argos (1.4.0-1) UNRELEASED; urgency=medium
argos (1.4.0-1) RELEASED; urgency=medium

* 1.4.0 release.

-- Matthias Meulien <[email protected]> Tue, 19 Oct 2022 19:08:28 +0200

argos (1.3.0-1) UNRELEASED; urgency=medium
argos (1.3.0-1) RELEASED; urgency=medium

* 1.3.0 release.

-- Matthias Meulien <[email protected]> Tue, 17 Sep 2022 20:43:28 +0200

argos (1.2.0-1) UNRELEASED; urgency=medium
argos (1.2.0-1) RELEASED; urgency=medium

* 1.2.0 release.

-- Matthias Meulien <[email protected]> Tue, 30 Aug 2022 20:56:28 +0200

argos (1.1.2-1) UNRELEASED; urgency=medium
argos (1.1.2-1) RELEASED; urgency=medium

* 1.1.2 release.

-- Matthias Meulien <[email protected]> Fri, 26 Aug 2022 23:31:28 +0200

argos (1.1.1-1) UNRELEASED; urgency=medium
argos (1.1.1-1) RELEASED; urgency=medium

* 1.1.1 release.

-- Matthias Meulien <[email protected]> Sat, 20 Aug 2022 11:22:28 +0200

argos (1.1.0-1) UNRELEASED; urgency=medium
argos (1.1.0-1) RELEASED; urgency=medium

* 1.1.0 release.

-- Matthias Meulien <[email protected]> Sat, 20 Aug 2022 11:22:28 +0200

argos (1.0.0-1) UNRELEASED; urgency=medium
argos (1.0.0-1) RELEASED; urgency=medium

* Initial release.

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('argos',
version: '1.15.0-rc0',
version: '1.15.0a0',
meson_version: '>= 0.50.0',
default_options: [ 'warning_level=2',
],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "argos"
version = "1.15.0-rc0"
version = "1.15.0a0"
description = "Gtk front-end to control a Mopidy server through a tiny touch screen"
authors = ["Matthias Meulien <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-deb-package
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION=$(poetry version | cut -d' ' -f 2)
VERSION=$(poetry version --short)
BUILDDIR=builddir

[ -d ${BUILDDIR} ] && {
Expand Down
2 changes: 1 addition & 1 deletion scripts/create-pre-release
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd "${MESON_SOURCE_ROOT}"

VERSION=$(poetry version | cut -d' ' -f 2)
VERSION=$(poetry version --short)

BODY="See [News file](https://github.com/orontee/argos/blob/v${VERSION}/NEWS.rst) for release content.
Expand Down
52 changes: 48 additions & 4 deletions scripts/prepare-next-release
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

NEWS_HEADER="[Unreleased]\n============\n\nAdded\n-----\n\nChanged\n-------\n\nRemoved\n-------\n"

cd "${MESON_SOURCE_ROOT}"

if [[ -n "$(git status --porcelain)" ]]; then
Expand All @@ -14,6 +12,52 @@ if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]; then
exit 1
fi

sed -i "11 i ${NEWS_HEADER}" NEWS.rst
git add NEWS.rst
CURRENT_VERSION=$(poetry version --short)
NEW_VERSION=$(poetry version --short preminor)

git add pyproject.toml
echo "Version set to ${NEW_VERSION}"

NEWS_HEADER="[Unreleased]\n============\n\nAdded\n-----\n\nChanged\n-------\n\nRemoved\n-------\n"

CHANGELOG_DATE=$(LANG=C date +"%a, %d %b %Y %H:%M:%S %z")
CHANGELOG_AUTHOR="$(git config user.name) <$(git config user.email)>"
CHANGELOG="argos (${NEW_VERSION}) UNRELEASED; urgency=medium
* ${NEW_VERSION} release.
-- ${CHANGELOG_AUTHOR} ${CHANGELOG_DATE}
"

update_news_file() {
local file_path="NEWS.rst"

echo "Updating ${file_path}..."
sed -i "11 i ${NEWS_HEADER}" ${file_path}

git add ${file_path}
}

update_debian_changelog() {
local file_path="debian/changelog"

echo "Updating ${file_path}..."
echo "$(echo "${CHANGELOG}"; cat ${file_path})" > ${file_path}

git add ${file_path}
}

update_meson_conf() {
local file_path="meson.build"

echo "Updating ${file_path}..."
sed -i "s/version: '${CURRENT_VERSION}'/version: '${NEW_VERSION}'/" ${file_path}

git add ${file_path}
}

update_news_file
update_debian_changelog
update_meson_conf

git commit -m "Prepare for next release"
17 changes: 5 additions & 12 deletions scripts/update-version
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

cd "${MESON_SOURCE_ROOT}"

CURRENT_VERSION=$(poetry version | cut -d' ' -f 2)
CURRENT_VERSION=$(poetry version --short)

NEW_VERSION=$(python -c "import semver; print(semver.VersionInfo.parse(\"${CURRENT_VERSION}\").bump_minor())")
NEW_VERSION=$(poetry version --short minor)

CHANGELOG_DATE=$(LANG=C date +"%a, %d %b %Y %H:%M:%S %z")
CHANGELOG_AUTHOR="$(git config user.name) <$(git config user.email)>"
Expand Down Expand Up @@ -39,7 +39,7 @@ update_readme_file() {
local file_path="README.rst"

echo "Updating ${file_path}..."
sed -i "s/VERSION=${CURRENT_VERSION}/VERSION=${NEW_VERSION}/" ${file_path}
sed -i "s/VERSION=.*/VERSION=${NEW_VERSION}/" ${file_path}
}

update_appdata_file() {
Expand All @@ -53,7 +53,8 @@ update_debian_changelog() {
local file_path="debian/changelog"

echo "Updating ${file_path}..."
echo "$(echo "${CHANGELOG}"; cat ${file_path})" > ${file_path}
sed -i "s/${CURRENT_VERSION}/${NEW_VERSION}/" ${file_path}
sed -i "s/${NEW_VERSION}) UNRELEASED/${NEW_VERSION}) RELEASED/" ${file_path}
}

update_meson_conf() {
Expand All @@ -63,16 +64,8 @@ update_meson_conf() {
sed -i "s/version: '${CURRENT_VERSION}'/version: '${NEW_VERSION}'/" ${file_path}
}

update_project_conf() {
local file_path="pyproject.toml"

echo "Updating ${file_path}..."
sed -i "s/version = .*/version = \"$NEW_VERSION\"/" ${file_path}
}

update_readme_file
update_meson_conf
update_project_conf
update_news_file
update_appdata_file
update_debian_changelog
Expand Down

0 comments on commit b087702

Please sign in to comment.