Use git tag as version
This commit is contained in:
parent
c1c43d2a41
commit
9cf42af251
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@ -22,11 +22,11 @@ jobs:
|
||||
os: [ windows-latest, ubuntu-latest, macos-latest ]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
BIN_SUFFIX:
|
||||
BIN_SUFFIX: ""
|
||||
- os: macos-latest
|
||||
BIN_SUFFIX:
|
||||
BIN_SUFFIX: ""
|
||||
- os: windows-latest
|
||||
BIN_SUFFIX: .exe
|
||||
BIN_SUFFIX: ".exe"
|
||||
steps:
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@v2
|
||||
@ -38,12 +38,14 @@ jobs:
|
||||
|
||||
- name: Setup vars
|
||||
id: vars
|
||||
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
|
||||
run: |
|
||||
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
|
||||
echo "::set-output name=git_tag::$(git describe --tags)"
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
CGO_ENABLED: 0
|
||||
run: go build -trimpath -ldflags="-w -s" -v -o um-${{ runner.os }}${{ matrix.BIN_SUFFIX }} ./cmd/um
|
||||
run: go build -trimpath -ldflags="-w -s -X main.AppVersion=${{ steps.vars.outputs.git_tag }}" -v -o um-${{ runner.os }}${{ matrix.BIN_SUFFIX }} ./cmd/um
|
||||
|
||||
- name: Publish artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
|
@ -18,12 +18,14 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
var AppVersion = "0.0.3"
|
||||
|
||||
func main() {
|
||||
app := cli.App{
|
||||
Name: "Unlock Music CLI",
|
||||
HelpName: "um",
|
||||
Usage: "Unlock your encrypted music file https://github.com/unlock-music/cli",
|
||||
Version: "v0.0.1",
|
||||
Version: AppVersion,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{Name: "input", Aliases: []string{"i"}, Usage: "path to input file or dir", Required: true},
|
||||
&cli.StringFlag{Name: "output", Aliases: []string{"o"}, Usage: "path to output dir", Required: true},
|
||||
|
Loading…
Reference in New Issue
Block a user