Skip to content

Commit a17098d

Browse files
authored
chore: add releases script (#1767)
* chore: add releases script Script is used to prep and push the errbot releases. * docs: update CHANGES
1 parent b074015 commit a17098d

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
v9.9.9 (unreleased)
22
-------------------
3+
- chore: add releases script (#1767)
34

45

56
v6.2.1 (2026-06-06)

tools/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,19 @@ These are support tools for the project
1111
`./gen_home.py`
1212

1313
- Generates a Github wiki compatible page named `Home.md` with all the plugins using `repos.json`
14+
15+
`./releases.sh`
16+
17+
- automates the release process for errbot.
18+
- creates a temporary directory, clones the repository, builds the python package, and prepares multi-arch docker images.
19+
- **Requirements:**
20+
- `git`
21+
- `pipenv`
22+
- `python 3.12`
23+
- `podman` (for docker image builds)
24+
- **Execution (macOS):**
25+
1. **Pre-requisite:** Open `tools/releases.sh` and update the `RELEASE`, `BRANCH`, and `PYTHON_VERSION` variables to match the target release.
26+
2. Ensure you have the requirements installed (e.g., `brew install pipenv podman`).
27+
3. Make the script executable: `chmod +x tools/releases.sh`
28+
4. Run the script from the project root: `./tools/releases.sh`
29+
5. Follow the manual steps printed at the end of the script to complete the publication.

tools/releases.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# notes
6+
## git cherry-pick <sha-of-bump-version>..master
7+
## git tag
8+
## git push upstream ${BRANCH}
9+
10+
RELEASE=6.2.1
11+
BRANCH=6.2
12+
PYTHON_VERSION=3.12
13+
14+
REPO=git@github.com:errbotio/errbot.git
15+
16+
RELEASE_DIR=$(mktemp -d /tmp/errbot-release-${RELEASE}.XXX)
17+
18+
19+
function header () {
20+
title=$@
21+
ORANGE='\033[0;33m'
22+
YELLOW='\033[1;33m'
23+
NC='\033[0m'
24+
25+
echo -e "${YELLOW}=================="
26+
echo -e "${ORANGE}${title}"
27+
echo -e "${YELLOW}=================="
28+
echo -e ${NC}
29+
}
30+
31+
32+
header "git clone"
33+
pushd ${RELEASE_DIR}
34+
git clone ${REPO} errbot
35+
pushd errbot
36+
git checkout ${BRANCH}
37+
38+
header "pypi build"
39+
pipenv --python ${PYTHON_VERSION}
40+
pipenv run pip3 install pytest twine build
41+
42+
#header "pre-release gate (version <-> CHANGES.rst)"
43+
#pipenv run python3 -m pytest tests/release_metadata_test.py -v
44+
45+
pipenv run python3 -m build
46+
47+
header "Building multi-arch docker images..."
48+
podman rmi -f errbotio/errbot:test 2>/dev/null || true
49+
podman manifest rm errbotio/errbot:test 2>/dev/null || true
50+
podman build --platform linux/amd64,linux/arm64 --manifest errbotio/errbot:test -f Dockerfile .
51+
52+
header "Checking and uploading Python package..."
53+
pipenv run twine check dist/*
54+
55+
header "Manual: publish pypi and docker"
56+
echo pipenv run twine upload dist/*
57+
echo podman build --platform linux/amd64,linux/arm64 --manifest errbotio/errbot:${RELEASE} -f Dockerfile .
58+
echo podman manifest push errbotio/errbot:${RELEASE} docker://docker.io/errbotio/errbot:${RELEASE}
59+
echo git tag v${RELEASE}
60+
61+
popd
62+
popd

0 commit comments

Comments
 (0)