Skip to content

Commit

Permalink
refactor: include commit in release binary
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluisq committed Nov 26, 2023
1 parent 1b2988d commit 1c40d04
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 29 deletions.
18 changes: 1 addition & 17 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/joseluisq/enve/cmd.versionNumber={{.Version}} -X github.com/joseluisq/enve/cmd.buildTime={{.Date}}
- -s -w -X github.com/joseluisq/enve/cmd.versionNumber={{.Version}} -X github.com/joseluisq/enve/cmd.buildCommit={{.Commit}} -X github.com/joseluisq/enve/cmd.buildTime={{.Date}}
goos:
- linux
- darwin
Expand Down Expand Up @@ -42,11 +42,6 @@ archives:
- id: enve
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format: tar.gz
replacements:
darwin: darwin
linux: linux
386: i386
amd64: amd64
files:
- LICENSE-APACHE
- LICENSE-MIT
Expand All @@ -56,17 +51,6 @@ release:
changelog:
skip: true

signs:
-
cmd: gpg
args:
- --output
- $signature
- --detach-sig
- $artifact
signature: ${artifact}.sig
artifacts: none

snapshot:
name_template: "{{ .Version }}"

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ prod.release:
set -u

@go version
@git tag $(GIT_TAG)
@goreleaser release --rm-dist
@git tag $(GIT_TAG) --sign -m "$(GIT_TAG)"
@goreleaser release --clean --skip=publish --skip=validate
.ONESHELL: prod.release

prod.release.ci:
set -e
set -u

@go version
@git tag $(DRONE_TAG)
@git tag $(GIT_TAG) --sign -m "$(GIT_TAG)"
@curl -sL https://git.io/goreleaser | bash
.ONESHELL: prod.release.ci
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

> Run a program in a modified environment providing a `.env` file.
**Enve** is a cross-platform tool which can load environment variables from a [`.env` file](https://www.ibm.com/docs/en/aix/7.2?topic=files-env-file) and execute a given command.
It also has the ability to output environment variables in `text`, `json` or `xml` format.
**Enve** is a cross-platform tool that can load environment variables from a [`.env` file](https://www.ibm.com/docs/en/aix/7.2?topic=files-env-file) and execute a given command.
It also can output environment variables in `text`, `json` or `xml` format.

It can be considered as a counterpart of [GNU env](https://www.gnu.org/software/coreutils/manual/html_node/env-invocation.html) command.

Expand All @@ -14,8 +14,8 @@ It can be considered as a counterpart of [GNU env](https://www.gnu.org/software/

```sh
curl -sSL \
"https://github.com/joseluisq/enve/releases/download/v1.4.1/enve_v1.4.1_linux_amd64.tar.gz" \
| sudo tar zxf - -C /usr/local/bin/ enve
"https://github.com/joseluisq/enve/releases/download/v1.4.2/enve_v1.4.2_linux_amd64.tar.gz" \
| sudo tar zxf - -C /usr/local/bin/ enve
```

Using Go:
Expand All @@ -28,7 +28,7 @@ Release binaries also available on [joseluisq/enve/releases](https://github.com/

## Usage

By default **enve** will print all environment variables like `env` command.
By default, **enve** will print all environment variables like `env` command.

```sh
enve
Expand All @@ -38,7 +38,7 @@ enve --output text

### Executing commands

By default, an optional `.env` file can be loaded from current working directory.
By default, an optional `.env` file can be loaded from the current working directory.

```sh
enve test.sh
Expand All @@ -63,7 +63,7 @@ enve --output xml
## Options

```
$ enve 1.4.1
$ enve 1.4.2
Run a program in a modified environment using .env files
USAGE:
Expand All @@ -80,10 +80,10 @@ OPTIONS:

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.

Feel free to send some [Pull request](https://github.com/joseluisq/enve/pulls) or [issue](https://github.com/joseluisq/enve/issues).
Feel free to send some [Pull request](https://github.com/joseluisq/enve/pulls) or file an [issue](https://github.com/joseluisq/enve/issues).

## License

This work is primarily distributed under the terms of both the [MIT license](LICENSE-MIT) and the [Apache License (Version 2.0)](LICENSE-APACHE).

© 2020-present [Jose Quintana](https://git.io/joseluisq)
© 2020-present [Jose Quintana](https://joseluisq.net)
2 changes: 2 additions & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
var (
versionNumber string = "devel"
buildTime string
buildCommit string
)

// Environment defines JSON/XML data structure
Expand All @@ -32,6 +33,7 @@ func Execute() {
app.Summary = "Run a program in a modified environment using .env files"
app.Version = versionNumber
app.BuildTime = buildTime
app.BuildCommit = buildCommit
app.Flags = []cli.Flag{
cli.FlagString{
Name: "file",
Expand Down

0 comments on commit 1c40d04

Please sign in to comment.