[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
merge-requests/139/merge
kali kaneko (leap communications) 2 years ago
parent eba7fe9f49
commit 2e8f2a2e8e
No known key found for this signature in database
GPG Key ID: 1CAF6C5B9F720808

2
.gitignore vendored

@ -21,6 +21,8 @@ lib/*
qtbuild/*
providers/assets
debian/files
.*.swp
*.exe

2
debian/changelog vendored

@ -1,4 +1,4 @@
riseup-vpn (0.21.2.1) groovy; urgency=medium
riseup-vpn (0.21.2.2) groovy; urgency=medium
* Initial Release.

@ -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

@ -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:

@ -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")
}

@ -0,0 +1 @@
0.21.2+git
Loading…
Cancel
Save