Skip to content

Commit

Permalink
prepare first release
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaumoron committed May 31, 2024
1 parent ba66def commit b63b1ef
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Dependency directories (remove the comment below to include it)
# vendor/

dist/
75 changes: 75 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy

builds:
- main: ./cmd/go
binary: go
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
- freebsd
- openbsd
- solaris

goarch:
- "386"
- amd64
- arm
- arm64

release:
name_template: "Release {{.Tag}}"

changelog:
use: github-native

archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{- .Os }}_{{- .Arch }}"

nfpms:
- file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}'
maintainer: 'https://github.com/dvaumoron'
homepage: https://github.com/dvaumoron/lastgo
description: >-
lastgo provides an alternative go command which is a proxy keeping up to date the Go toolchain (see https://go.dev).
license: "Apache-2.0"
formats:
- deb
- rpm
- apk
bindir: /usr/bin
section: default
contents:
- src: ./LICENSE
dst: /usr/share/doc/gosince/copyright
file_info:
mode: 0444
rpm:
signature:
key_file: "{{ if index .Env \"GPG_KEY_FILE\" }}{{.Env.GPG_KEY_FILE}}{{ end }}"
deb:
signature:
key_file: "{{ if index .Env \"GPG_KEY_FILE\" }}{{.Env.GPG_KEY_FILE}}{{ end }}"

brews:
- repository:
owner: dvaumoron
name: homebrew-tap
directory: Formula
homepage: https://github.com/dvaumoron/lastgo
description: provides an alternative go command which is a proxy keeping up to date the Go toolchain (see https://go.dev).
license: "Apache-2.0"
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# lastgo

The **lastgo** project provides an alternative `go` command which is a proxy keeping up to date the [Go](https://go.dev) toolchain.

## Getting started

Install via [Homebrew](https://brew.sh)

```console
$ brew tap dvaumoron/tap
$ brew install lastgo
```

Or get the [last binary](https://github.com/dvaumoron/lastgo/releases) depending on your OS.

## Environment Variables

### LASTGO_ASK

String (Default: "")

When non empty, **lastgo** ask user for confirmation before an update.

### LASTGO_CHECK_INTERVAL

String (Default: 24h)

Minimum interval waited between check of last version on `LASTGO_DOWNLOAD_URL`.

### LASTGO_DOWNLOAD_URL

String (Default: https://go.dev/dl)

URL to download Go binary (only used to install at first launch, update rely on **Go** `GOTOOLCHAIN` mecanism).

### LASTGO_ROOT

String (Default: ${HOME}/.lastgo)

Path to directory where **lastgo** install `go`.
2 changes: 1 addition & 1 deletion pkg/goversion/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type version struct {
}

func init() {
versionRegexp = regexp.MustCompilePOSIX("go[0-9]+(\\.[0-9]+)*")
versionRegexp = regexp.MustCompilePOSIX("go[0-9]+\\.[0-9]+(\\.[0-9]+)?")
}

// return a go version (like "go1.22.3").
Expand Down

0 comments on commit b63b1ef

Please sign in to comment.