Merge lp:~james-w/libdep-service-python/make-release into lp:libdep-service-python

Proposed by James Westby
Status: Merged
Approved by: Jonathan Lange
Approved revision: 12
Merged at revision: 16
Proposed branch: lp:~james-w/libdep-service-python/make-release
Merge into: lp:libdep-service-python
Diff against target: 26 lines (+19/-0)
1 file modified
Makefile (+19/-0)
To merge this branch: bzr merge lp:~james-w/libdep-service-python/make-release
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Review via email: mp+130428@code.launchpad.net

Commit message

Add some release automation.

Description of the change

Hi,

Here's a stab at automating the second part of the release process.

We might want to automate the first part too, but I think trying to do all
of it in one operation is a mistake because of the multiple moving parts.

I welcome ideas for other approaches, this was just the easiest way I could
see to fold the steps on the wiki page in to a script.

Thanks,

James

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

On 18 October 2012 21:42, James Westby <email address hidden> wrote:
> James Westby has proposed merging lp:~james-w/libdep-service-python/make-release into lp:libdep-service-python.
>
> Commit message:
> Add some release automation.
>
> Requested reviews:
> Canonical Consumer Applications Hackers (canonical-ca-hackers)
>
> For more details, see:
> https://code.launchpad.net/~james-w/libdep-service-python/make-release/+merge/130428
>
> Hi,
>
> Here's a stab at automating the second part of the release process.
>
> We might want to automate the first part too, but I think trying to do all
> of it in one operation is a mistake because of the multiple moving parts.
>

+1

> I welcome ideas for other approaches, this was just the easiest way I could
> see to fold the steps on the wiki page in to a script.
>

I think this is a good approach. I think it might be better to read
the version number out of the NEWS file (or similar), rather than
require it to be specified, since if everything has gone correctly
with the previous step, it has already been specified.

cheers,
jml

12. By James Westby

Read the version from the $(VERSION_FILE) rather than requiring it to be specified.

Revision history for this message
James Westby (james-w) wrote :

Good point.

I've modified it to read $(VERSION_FILE), and to check that the tag isn't already
there (to try and catch us when we run "make release" thinking it might do the first
part)

Thanks,

James

Revision history for this message
Jonathan Lange (jml) wrote :

Great, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2012-10-01 18:34:11 +0000
3+++ Makefile 2012-10-19 20:29:20 +0000
4@@ -16,3 +16,22 @@
5
6
7 TEST_COMMAND=$(PY) -m testtools.run discover libdep_service_client
8+
9+PROJECT_NAME=libdep-service-python
10+VERSION_FILE=libdep_service_client/__init__.py
11+NEWS_FILE=NEWS
12+LP_PROJECT=libdep-service-python
13+VERSION=$(shell grep "^__version__ " "$(VERSION_FILE)" | sed -e "s/.*=\s*'\([^']\+\)'.*/\1/")
14+
15+release:
16+ @echo Releasing version $(VERSION)
17+ @(bzr tags | grep -vq "^$(VERSION)\s") || (echo "Tag already exists for $(VERSION), remove it and run again" && exit 1)
18+ @grep -q "^$(VERSION)\s" "$(NEWS_FILE)" || (echo "No entry for $(VERSION) in NEWS" && exit 1)
19+ python setup.py sdist upload --sign
20+ bzr tag "$(VERSION)"
21+ bzr push lp:$(LP_PROJECT)
22+ cp "dist/$(PROJECT_NAME)-$(VERSION).tar.gz" $(CA_DOWNLOAD_CACHE_DIR)/dist
23+ bzr add "$(CA_DOWNLOAD_CACHE_DIR)/dist/$(PROJECT_NAME)-$(VERSION).tar.gz"
24+ bzr ci "$(CA_DOWNLOAD_CACHE_DIR)/dist/$(PROJECT_NAME)-$(VERSION).tar.gz" -m "Add $(PROJECT_NAME) $(VERSION)."
25+
26+.PHONY: release

Subscribers

People subscribed via source and target branches