File tree Expand file tree Collapse file tree 3 files changed +42
-5
lines changed Expand file tree Collapse file tree 3 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 88
99jobs :
1010 build :
11- runs-on : ubuntu-latest
11+ runs-on : ${{ matrix.os }}
1212
1313 strategy :
1414 matrix :
15+ os : [ubuntu-latest, windows-latest, macos-latest]
1516 go-version : [1.23.x]
1617
1718 steps :
@@ -42,14 +43,27 @@ jobs:
4243 - name : Build
4344 run : go build -v ./...
4445
45- - name : Build binary
46+ - name : Build binary (Unix)
47+ if : runner.os != 'Windows'
4648 run : go build -o grove .
4749
50+ - name : Build binary (Windows)
51+ if : runner.os == 'Windows'
52+ run : go build -o grove.exe .
53+
4854 - name : Test
4955 run : go test -v ./...
5056
51- - name : Upload binary
57+ - name : Upload binary (Unix)
58+ if : runner.os != 'Windows'
59+ uses : actions/upload-artifact@v4
60+ with :
61+ name : grove-${{ runner.os }}
62+ path : grove
63+
64+ - name : Upload binary (Windows)
65+ if : runner.os == 'Windows'
5266 uses : actions/upload-artifact@v4
5367 with :
5468 name : grove-${{ runner.os }}
55- path : grove
69+ path : grove.exe
Original file line number Diff line number Diff line change 1- //go:build !darwin && !linux
1+ //go:build !darwin && !linux && !windows
22
33package git
44
Original file line number Diff line number Diff line change 1+ //go:build windows
2+
3+ package git
4+
5+ import (
6+ "os"
7+ "syscall"
8+ "time"
9+ )
10+
11+ func getCreatedTime (path string ) (time.Time , error ) {
12+ info , err := os .Stat (path )
13+ if err != nil {
14+ return time.Time {}, err
15+ }
16+
17+ // Windows has creation time in the file info
18+ if stat , ok := info .Sys ().(* syscall.Win32FileAttributeData ); ok {
19+ return time .Unix (0 , stat .CreationTime .Nanoseconds ()), nil
20+ }
21+
22+ return info .ModTime (), nil
23+ }
You can’t perform that action at this time.
0 commit comments