1# Picard release process
2
3
4## Release preparation (few weeks/days before)
5
6
7### Synchronize picard.pot with sources
8
9```bash
10python setup.py regen_pot_file && git diff --quiet || git commit -m 'Update pot file' -- po/picard.pot
11```
12
13And push changes to main remote repository, see [po/README.md](po/README.md) for details about translations
14
15## Ensure git repository tree is clean
16
17From the local repository:
18
19### Check out the repo master branch
20
21```bash
22git fetch $PICARD_REMOTE && git checkout master
23```
24
25### Ensure nothing is on the way
26
27```bash
28git reset --hard $PICARD_REMOTE/master && git clean -f -d
29```
30
31
32#### Remove old compiled modules
33
34```bash
35find . -type f -name '*.pyc' -exec rm -f {} \;
36```
37
38### Tag to save the current state
39
40```bash
41git tag "before-release-$PICARD_VERSION" --force
42```
43
44### Remove any BOM nasty bytes from files
45
46This shouldn't be needed, but better to check before releasing
47
48```bash
49git ls-tree --full-tree -r HEAD --name-only |while read f; do sed -i '1s/^\xEF\xBB\xBF//' "$f"; done && git diff --quiet || git commit -a -m 'Remove nasty BOM bytes'
50```
51
52## Get latest translations from Transifex
53
54```bash
55python setup.py pull_translations && git diff --quiet || git commit -m 'Update .po files' -- po/
56```
57
58## Synchronize generated consts
59
60```bash
61python setup.py update_constants && git diff --quiet || git commit -a -m 'Update constants' -- picard/const/*.py
62```
63
64## Update NEWS.txt
65
66TODO: explain how
67
68## Update Picard version
69
70Edit `picard/__init__.py` and set new version tuple
71
72Run tests:
73
74```bash
75python setup.py test
76```
77
78Commit changes!
79
80
81## Tag new version
82
83```bash
84git tag -s "$PICARD_RELEASE_TAG" -m "Release $PICARD_VERSION"
85```
86
87Stable release tags have the following format: `release-#.#.#`
88Example: `release-2.1.0`
89
90## Update Picard version to next dev version
91
92Edit `picard/__init__.py` and set new dev version tuple.
93
94Run tests:
95
96```bash
97python setup.py test
98```
99
100Commit changes!
101
102
103## Push new commits and tags to remote
104
105```bash
106git push "$PICARD_REMOTE" master:master
107git push "$PICARD_REMOTE" tag "$PICARD_RELEASE_TAG"
108```
109
110### To revert after push
111
112```bash
113git tag -d "release-$PICARD_VERSION"
114git reset --hard "before-release-$PICARD_VERSION"
115git push "$PICARD_REMOTE" :"$TAG"
116git push "$PICARD_REMOTE" "before-release-$PICARD_VERSION":master --force
117```
118