Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version incrementing script #404

Merged
merged 3 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include dom0/securedrop-update
include config.json.example
include README.md
include LICENSE
include VERSION
include Makefile
include sd-proxy/*
include sd-svs/*
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.1
7 changes: 5 additions & 2 deletions rpm-build/SPECS/securedrop-workstation-dom0-config.spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Name: securedrop-workstation-dom0-config
Version: 0.0.1
Version: 0.1.1
Release: 1%{?dist}
Summary: SecureDrop Workstation

Group: Library
License: GPLv3+
URL: https://github.com/freedomofpress/securedrop-workstation
Source0: securedrop-workstation-dom0-config-0.0.1.tar.gz
Source0: securedrop-workstation-dom0-config-0.1.1.tar.gz

BuildArch: noarch
BuildRequires: python3-setuptools
Expand Down Expand Up @@ -64,6 +64,9 @@ find /srv/salt -maxdepth 1 -type f -iname '*.top' \
| xargs qubesctl top.enable > /dev/null

%changelog
* Fri Jan 10 2020 redshiftzero <jen@freedom.press> - 0.1.1
- First alpha release.

* Fri Oct 26 2018 Kushal Das <kushal@freedom.press> - 0.0.1-1
- First release

7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

with open("VERSION", "r", encoding="utf-8") as f:
version = f.read().strip()

setuptools.setup(
name="securedrop-workstation-dom0-config",
version="0.0.1",
author="Kushal Das",
author="SecureDrop Team",
version=version,
author_email="securedrop@freedom.press",
description="SecureDrop Workstation",
long_description=long_description,
Expand Down
32 changes: 32 additions & 0 deletions update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
## Usage: ./update_version.sh <version>

set -e

readonly NEW_VERSION=$1

if [ -z "$NEW_VERSION" ]; then
echo "You must specify the new version!"
exit 1
fi

OLD_VERSION=$(cat VERSION)

if [ -z "$OLD_VERSION" ]; then
echo "Couldn't find the old version: does this script need to be updated?"
exit 1
fi

# Update the version in rpm-build/SPECS/securedrop-workstation-dom0-config.spec and setup.py
# We just change Source0 and Version fields in the rpm spec. The spec file also contains the changelog entries,
# and we don't want to increment those versions.
if [[ "$OSTYPE" == "darwin"* ]]; then
# The empty '' after sed -i is required on macOS to indicate no backup file should be saved.
sed -i '' "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" VERSION
sed -i '' -e "/Source0/s/$OLD_VERSION/$NEW_VERSION/" rpm-build/SPECS/securedrop-workstation-dom0-config.spec
sed -i '' -e "/Version/s/$OLD_VERSION/$NEW_VERSION/" rpm-build/SPECS/securedrop-workstation-dom0-config.spec
else
sed -i "s@$(echo "${OLD_VERSION}" | sed 's/\./\\./g')@$NEW_VERSION@g" VERSION
sed -i -e "/Source0/s/$OLD_VERSION/$NEW_VERSION/" rpm-build/SPECS/securedrop-workstation-dom0-config.spec
sed -i -e "/Version/s/$OLD_VERSION/$NEW_VERSION/" rpm-build/SPECS/securedrop-workstation-dom0-config.spec
fi