summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-04-14 16:47:04 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-04-14 16:49:53 +0200
commit2e8f2a2e8e83fd89f956cdde886d5d9d808132da (patch)
tree84312e815be8c092dcbe22955df439969972cc92
parenteba7fe9f49a5156991ec0924ab86848fb681f03a (diff)
[pkg] modify version gen to read static version file
this can be used from any build script to distinguish the version string that will be displayed (ie: 0.21.2-debian-1) - Resolves: #468
-rw-r--r--.gitignore2
-rw-r--r--debian/changelog2
-rw-r--r--docs/build-ppa.rst11
-rw-r--r--docs/release-howto.rst16
-rw-r--r--pkg/config/version/genver/main.go14
-rw-r--r--pkg/version1
6 files changed, 33 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index 59198b3..60c4b60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,8 @@ lib/*
qtbuild/*
providers/assets
+debian/files
+
.*.swp
*.exe
diff --git a/debian/changelog b/debian/changelog
index 9febc48..fb29b86 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-riseup-vpn (0.21.2.1) groovy; urgency=medium
+riseup-vpn (0.21.2.2) groovy; urgency=medium
* Initial Release.
diff --git a/docs/build-ppa.rst b/docs/build-ppa.rst
new file mode 100644
index 0000000..abc9b7e
--- /dev/null
+++ b/docs/build-ppa.rst
@@ -0,0 +1,11 @@
+ppa howto
+=========
+
+* Add changes to changelog (bump native dot-version, change release)
+* Upload changes file
+
+.. code:: bash
+
+ debuild -i -S
+ dput --force ppa:kalikaneko/ppa ../riseup-vpn_0.21.2.2_source.changes
+
diff --git a/docs/release-howto.rst b/docs/release-howto.rst
index 98bd939..a0da551 100644
--- a/docs/release-howto.rst
+++ b/docs/release-howto.rst
@@ -1,7 +1,9 @@
-how to make a release
+Release procedure
=====================
-1. Tag the release
-2. Build the latest builder image:
+1. Bump the static release file in `pkg/version`. After a release, this should read something like `0.21.2+git`. This file is used to generate version strings from tarballs.
+
+2. Tag the release
+3. Build the latest builder image:
```
make builder_image
@@ -18,13 +20,7 @@ make package_snap_in_docker
4. Build the windows installer:
-This is a bit complicated, since it is a two-stage build. It will need you have
-cloned the secrets folder containing the windows authenticode. You also have to
-have wine (32 bits) installed in your host machine.
-
-```
-make package_win_in_docker
-```
+(TBD)
5. Build the OSX package:
diff --git a/pkg/config/version/genver/main.go b/pkg/config/version/genver/main.go
index e0d80b0..d4b72d8 100644
--- a/pkg/config/version/genver/main.go
+++ b/pkg/config/version/genver/main.go
@@ -3,6 +3,7 @@ package main
import (
"flag"
"io"
+ "io/ioutil"
"log"
"os"
"os/exec"
@@ -43,7 +44,7 @@ func main() {
vers, err := GitDescribe(dir)
if err != nil {
- log.Fatal(err)
+ vers = ReadVersionFile(dir)
}
vp := VersionPackage{
Name: *flPackageName,
@@ -70,7 +71,7 @@ var packageLayout = `package {{.Name}}
// AUTO-GENERATED. DO NOT EDIT
// {{.Date}}
-// {{.Variable}} is generated by git-describe from gen.go
+// {{.Variable}} is generated by git-describe or static version file from gen.go
var {{.Variable}} = "{{.Version}}"
`
@@ -93,3 +94,12 @@ func GitDescribe(path string) (string, error) {
return strings.TrimSpace(string(buf)), nil
}
+
+func ReadVersionFile(path string) string {
+ versionFile := filepath.Join(path, "../../../version")
+ content, err := ioutil.ReadFile(versionFile)
+ if err != nil {
+ return "unknown"
+ }
+ return strings.Trim(string(content), "\n")
+}
diff --git a/pkg/version b/pkg/version
new file mode 100644
index 0000000..146720c
--- /dev/null
+++ b/pkg/version
@@ -0,0 +1 @@
+0.21.2+git