Compare commits

...

4 Commits

Author SHA1 Message Date
Pete Davison
3c30a8066d feat: bump minor version when repo is dirty or untagged 2025-08-06 19:45:37 +00:00
Valentin Maerten
26ef693417 chore: publish nightly (#2246)
Co-authored-by: Andrey Nering <andreynering@users.noreply.github.com>
2025-08-06 20:29:36 +02:00
renovate[bot]
952f32d388 chore(deps): update all non-major dependencies (#2351)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-06 10:51:19 -03:00
Andrey Nering
e72c35f79f fix(goreleaser): fix automatic submission of winget pr 2025-07-28 10:59:45 -03:00
8 changed files with 133 additions and 27 deletions

29
.github/workflows/release-nightly.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Realease nightly
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: release --clean --nightly
env:
GITHUB_TOKEN: ${{secrets.GH_PAT}}
GORELEASER_KEY: ${{secrets.GORELEASER_KEY}}

View File

@@ -36,7 +36,7 @@ gomod:
proxy: true
archives:
- name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}"
- name_template: '{{.Binary}}_{{.Os}}_{{.Arch}}'
files:
- README.md
- LICENSE
@@ -48,11 +48,21 @@ archives:
release:
draft: true
git:
ignore_tags:
- "{{if not .IsNightly}}nightly{{end}}"
nightly:
publish_release: true
keep_single_release: true
version_template: "{{incminor .Version}}-nightly"
snapshot:
version_template: "{{.Version}}"
version_template: '{{.Version}}'
checksum:
name_template: "task_checksums.txt"
name_template: 'task_checksums.txt'
nfpms:
- vendor: Task
@@ -66,7 +76,7 @@ nfpms:
formats:
- deb
- rpm
file_name_template: "{{.ProjectName}}_{{.Os}}_{{.Arch}}"
file_name_template: '{{.ProjectName}}_{{.Os}}_{{.Arch}}'
contents:
- src: completion/bash/task.bash
dst: /etc/bash_completion.d/task
@@ -84,8 +94,7 @@ brews:
repository:
owner: go-task
name: homebrew-tap
test:
system "#{bin}/task", "--help"
test: system "#{bin}/task", "--help"
install: |-
bin.install "task"
bash_completion.install "completion/bash/task.bash" => "task"
@@ -108,7 +117,7 @@ winget:
commit_author:
name: task-bot
email: 106601941+task-bot@users.noreply.github.com
commit_msg_template: "chore: bump {{.PackageIdentifier}} to {{.Tag}}"
commit_msg_template: 'chore: release {{.PackageIdentifier}} {{.Tag}}'
release_notes_url: https://github.com/go-task/task/releases/tag/{{.Tag}}
tags:
- build
@@ -122,13 +131,15 @@ winget:
- task-runner
- taskfile
- tool
skip_upload: true
repository:
owner: microsoft
owner: go-task
name: winget-pkgs
branch: 'chore/task-{{.Version}}'
pull_request:
enabled: true
draft: false
check_boxes: true
base:
owner: go-task
owner: microsoft
name: winget-pkgs
branch: "bump-task-to-{{.Tag}}"
branch: master

2
.nvmrc
View File

@@ -1 +1 @@
22.17.1
22.18.0

2
go.mod
View File

@@ -5,7 +5,7 @@ go 1.23.0
require (
github.com/Ladicle/tabwriter v1.0.0
github.com/Masterminds/semver/v3 v3.4.0
github.com/alecthomas/chroma/v2 v2.19.0
github.com/alecthomas/chroma/v2 v2.20.0
github.com/chainguard-dev/git-urls v1.0.2
github.com/davecgh/go-spew v1.1.1
github.com/dominikbraun/graph v0.23.0

2
go.sum
View File

@@ -13,6 +13,8 @@ github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8v
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/chroma/v2 v2.19.0 h1:Im+SLRgT8maArxv81mULDWN8oKxkzboH07CHesxElq4=
github.com/alecthomas/chroma/v2 v2.19.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk=
github.com/alecthomas/chroma/v2 v2.20.0 h1:sfIHpxPyR07/Oylvmcai3X/exDlE8+FA820NTz+9sGw=
github.com/alecthomas/chroma/v2 v2.20.0/go.mod h1:e7tViK0xh/Nf4BYHl00ycY6rV7b8iXBksI9E359yNmA=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=

View File

@@ -4,6 +4,8 @@ import (
_ "embed"
"runtime/debug"
"strings"
"github.com/Masterminds/semver/v3"
)
var (
@@ -46,6 +48,10 @@ func getCommit(info *debug.BuildInfo) string {
// However, it can also be overridden at build time using:
// -ldflags="-X 'github.com/go-task/task/v3/internal/version.version=vX.X.X'".
func GetVersion() string {
// If its a development version, we bump the minor version.
if commit != "" || dirty {
return semver.MustParse(version).IncMinor().String()
}
return version
}
@@ -61,7 +67,7 @@ func GetVersionWithBuildInfo() string {
buildMetadata = append(buildMetadata, "dirty")
}
if len(buildMetadata) > 0 {
return version + "+" + strings.Join(buildMetadata, ".")
return GetVersion() + "+" + strings.Join(buildMetadata, ".")
}
return version
return GetVersion()
}

View File

@@ -0,0 +1,58 @@
package version
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestVersionTxt(t *testing.T) {
// Check that the version.txt is a valid semver version.
require.NotEmpty(t, GetVersion(), "version.txt is not semver compliant")
}
func TestGetVersion(t *testing.T) {
tests := []struct {
version string
commit string
dirty bool
want string
}{
{"1.2.3", "", false, "1.2.3"},
{"1.2.3", "", true, "1.3.0"},
{"1.2.3", "abcdefg", false, "1.3.0"},
{"1.2.3", "abcdefg", true, "1.3.0"},
}
for _, tt := range tests {
version = tt.version
commit = tt.commit
dirty = tt.dirty
t.Run(tt.want, func(t *testing.T) {
require.Equal(t, tt.want, GetVersion())
})
}
}
func TestGetVersionWithBuildInfo(t *testing.T) {
tests := []struct {
version string
commit string
dirty bool
want string
}{
{"1.2.3", "", false, "1.2.3"},
{"1.2.3", "", true, "1.3.0+dirty"},
{"1.2.3", "abcdefg", false, "1.3.0+abcdefg"},
{"1.2.3", "abcdefg", true, "1.3.0+abcdefg.dirty"},
}
for _, tt := range tests {
version = tt.version
commit = tt.commit
dirty = tt.dirty
t.Run(tt.want, func(t *testing.T) {
require.Equal(t, tt.want, GetVersionWithBuildInfo())
})
}
}

View File

@@ -2445,9 +2445,9 @@
"@types/react" "*"
"@types/react@*", "@types/react@^19.0.0":
version "19.1.8"
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.1.8.tgz#ff8395f2afb764597265ced15f8dddb0720ae1c3"
integrity sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==
version "19.1.9"
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.1.9.tgz#f42b24f35474566a39b5c3a98e4d0c425b79a849"
integrity sha512-WmdoynAX8Stew/36uTSVMcLJJ1KRh6L3IZRx1PZ7qJtBqT3dYTgyDTx8H1qoRghErydW7xw9mSJ3wS//tCRpFA==
dependencies:
csstype "^3.0.2"
@@ -7219,9 +7219,9 @@ rc@1.2.8:
strip-json-comments "~2.0.1"
react-dom@^19.0.0:
version "19.1.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.1.0.tgz#133558deca37fa1d682708df8904b25186793623"
integrity sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==
version "19.1.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.1.1.tgz#2daa9ff7f3ae384aeb30e76d5ee38c046dc89893"
integrity sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==
dependencies:
scheduler "^0.26.0"
@@ -7301,9 +7301,9 @@ react-router@5.3.4, react-router@^5.3.4:
tiny-warning "^1.0.0"
react@^19.0.0:
version "19.1.0"
resolved "https://registry.yarnpkg.com/react/-/react-19.1.0.tgz#926864b6c48da7627f004795d6cce50e90793b75"
integrity sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==
version "19.1.1"
resolved "https://registry.yarnpkg.com/react/-/react-19.1.1.tgz#06d9149ec5e083a67f9a1e39ce97b06a03b644af"
integrity sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==
readable-stream@^2.0.1:
version "2.3.8"
@@ -8278,9 +8278,9 @@ typedarray-to-buffer@^3.1.5:
is-typedarray "^1.0.0"
typescript@^5.3.3:
version "5.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e"
integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==
version "5.9.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.2.tgz#d93450cddec5154a2d5cabe3b8102b83316fb2a6"
integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==
undici-types@~6.21.0:
version "6.21.0"