mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-09 22:38:10 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f6fefceef | ||
|
|
43c473d482 | ||
|
|
e69858105a |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -44,6 +44,8 @@ jobs:
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: ./go.mod
|
||||
- name: Install garble
|
||||
run: go install mvdan.cc/garble@latest
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
|
||||
@@ -11,14 +11,30 @@ before:
|
||||
# - go generate ./...
|
||||
|
||||
builds:
|
||||
- env:
|
||||
- id: default
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
- linux
|
||||
main: ./cmd/fabric
|
||||
binary: fabric
|
||||
- id: windows-garbled
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- windows
|
||||
main: ./cmd/fabric
|
||||
binary: fabric
|
||||
tool: garble
|
||||
# From https://github.com/eyevanovich/garble-goreleaser-example/blob/main/.goreleaser.yaml
|
||||
# command is a single string.
|
||||
# garble's 'build' needs the -literals and -tiny args before it, so we
|
||||
# trick goreleaser into using -literals as command, and pass -tiny and
|
||||
# build as flags.
|
||||
command: "-literals"
|
||||
flags: [ "-tiny", "-seed=random", "build" ]
|
||||
ldflags: [ "-s", "-w" ]
|
||||
|
||||
archives:
|
||||
- formats: [tar.gz]
|
||||
|
||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -117,6 +117,7 @@
|
||||
"modeline",
|
||||
"modelines",
|
||||
"mpga",
|
||||
"mvdan",
|
||||
"nicksnyder",
|
||||
"nixpkgs",
|
||||
"nometa",
|
||||
|
||||
5359
CHANGELOG.md
5359
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,3 @@
|
||||
package main
|
||||
|
||||
var version = "v1.4.312"
|
||||
var version = "v1.4.313"
|
||||
|
||||
Binary file not shown.
@@ -180,6 +180,15 @@ func (w *Walker) WalkHistory() (map[string]*Version, error) {
|
||||
return nil, fmt.Errorf("failed to get commit log: %w", err)
|
||||
}
|
||||
|
||||
// Get the latest tag to know the boundary between released and unreleased
|
||||
latestTag, _ := w.GetLatestTag()
|
||||
var latestTagHash plumbing.Hash
|
||||
if latestTag != "" {
|
||||
if tagRef, err := w.repo.Tag(latestTag); err == nil {
|
||||
latestTagHash = tagRef.Hash()
|
||||
}
|
||||
}
|
||||
|
||||
versions := make(map[string]*Version)
|
||||
currentVersion := "Unreleased"
|
||||
versions[currentVersion] = &Version{
|
||||
@@ -188,8 +197,18 @@ func (w *Walker) WalkHistory() (map[string]*Version, error) {
|
||||
}
|
||||
|
||||
prNumbers := make(map[string][]int)
|
||||
passedLatestTag := false
|
||||
// If there's no latest tag, treat all commits as belonging to their found versions
|
||||
if latestTag == "" {
|
||||
passedLatestTag = true
|
||||
}
|
||||
|
||||
err = commitIter.ForEach(func(c *object.Commit) error {
|
||||
// Check if we've passed the latest tag boundary
|
||||
if !passedLatestTag && latestTagHash != (plumbing.Hash{}) && c.Hash == latestTagHash {
|
||||
passedLatestTag = true
|
||||
}
|
||||
|
||||
// c.Message = Summarize(c.Message)
|
||||
commit := &Commit{
|
||||
SHA: c.Hash.String(),
|
||||
@@ -203,7 +222,12 @@ func (w *Walker) WalkHistory() (map[string]*Version, error) {
|
||||
if matches := versionPattern.FindStringSubmatch(commit.Message); len(matches) > 1 {
|
||||
commit.IsVersion = true
|
||||
commit.Version = matches[1]
|
||||
currentVersion = commit.Version
|
||||
|
||||
// Only change currentVersion if we're past the latest tag
|
||||
// This keeps newer commits as "Unreleased"
|
||||
if passedLatestTag {
|
||||
currentVersion = commit.Version
|
||||
}
|
||||
|
||||
if _, exists := versions[currentVersion]; !exists {
|
||||
versions[currentVersion] = &Version{
|
||||
|
||||
@@ -1 +1 @@
|
||||
"1.4.312"
|
||||
"1.4.313"
|
||||
|
||||
Reference in New Issue
Block a user