Compare commits

..

4 Commits

Author SHA1 Message Date
Henrique Dias
9562e06b92 chore: version v2.0.8 2019-05-12 21:09:05 +01:00
Henrique Dias
7fc4899507 chore: versioning with ldflags (#726)
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
2019-05-12 21:08:43 +01:00
Henrique Dias
d649ae6ff7 feat: use new docs links 2019-05-12 10:58:44 +01:00
Henrique Dias
a65cb32d70 chore: setting untracked version [ci skip] 2019-05-12 09:50:10 +01:00
6 changed files with 22 additions and 27 deletions

View File

@@ -1,8 +1,17 @@
project_name: filebrowser
env:
- GO111MODULE=on
before:
hooks:
- go mod download
build:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/filebrowser/filebrowser/v2/version.Version={{ .Version }} -X github.com/filebrowser/filebrowser/v2/version.CommitSHA={{ .ShortCommit }}
main: main.go
binary: filebrowser
goos:

View File

@@ -16,16 +16,16 @@ filebrowser provides a file managing interface within a specified directory and
## Features
Please refer to our docs at [docs.filebrowser.xyz/features](https://docs.filebrowser.xyz/features)
Please refer to our docs at [filebrowser.xyz/features](https://filebrowser.xyz/features)
## Install
Please refer to our docs at [docs.filebrowser.xyz](https://docs.filebrowser.xyz/).
Please refer to our docs at [filebrowser.xyz](https://filebrowser.xyz/).
## Usage
Please refer to our docs at [docs.filebrowser.xyz/usage](https://docs.filebrowser.xyz/usage).
Please refer to our docs at [filebrowser.xyz/usage](https://filebrowser.xyz/usage).
## Contributing
Please refer to our docs at [docs.filebrowser.xyz/contributing](https://docs.filebrowser.xyz/contributing).
Please refer to our docs at [filebrowser.xyz/contributing](https://filebrowser.xyz/contributing).

View File

@@ -15,6 +15,6 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("File Browser Version " + version.Version)
fmt.Println("File Browser v" + version.Version + "/" + version.CommitSHA)
},
}

View File

@@ -1,6 +1,8 @@
package version
const (
var (
// Version is the current File Browser version.
Version = "v2.0.7"
Version = "(untracked)"
// CommitSHA is the commmit sha.
CommitSHA = "(unknown)"
)

View File

@@ -16,14 +16,6 @@ debugInfo () {
echo "Release: $RELEASE"
}
updateVersion () {
from=$1
to=$2
echo "🎁 Updating version from \"$from\" to \"$to\""
sed -i.bak "s|$from|$to|g" $REPO/version/version.go
}
buildAssets () {
cd $REPO
rm -rf frontend/dist
@@ -50,9 +42,7 @@ buildBinary () {
rice embed-go
cd $REPO
updateVersion $untracked "($COMMIT_SHA)"
go build -a -o filebrowser
updateVersion "($COMMIT_SHA)" $untracked
go build -a -o filebrowser -ldflags "-s -w -X github.com/filebrowser/filebrowser/v2/version.CommitSHA=$COMMIT_SHA"
}
release () {
@@ -90,18 +80,12 @@ release () {
cd ..
echo "🐑 Updating submodule ref to $semver"
updateVersion $untracked $1
git commit -am "chore: version $semver"
echo "🐑 Creating a new commit for the new release"
git commit --allow-empty -am "chore: version $semver"
git tag "$1"
git push
git push --tags origin
echo "🐑 Commiting untracked version notice..."
updateVersion $1 $untracked
git commit -am "chore: setting untracked version [ci skip]"
git push
echo "📦 Done! $semver released."
}