Skip to content

Commit 734a93a

Browse files
committed
Try to fix version in action
1 parent cdb1ef7 commit 734a93a

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

.github/workflows/main.yaml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,36 @@ jobs:
99
contents: write
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
12+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.1
1313
- name: Set up Go
14-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # 5.5.0
14+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.0.0
1515
with:
1616
go-version: '>=1.21.0'
1717
- name: Display Go version
1818
run: go version
19-
- name: Get the version tag
20-
id: get-tag
21-
if: startsWith(github.ref, 'refs/tags/')
22-
run: echo "tag=${GITHUB_REF##*/}" >> $env:GITHUB_OUTPUT
2319
- name: Windows Build
2420
run: |
2521
$Env:GOOS='windows'
26-
go build -ldflags="-X main.Version=${{ steps.get-tag.outputs.tag }}" -o GoReSym.exe
22+
go build -ldflags="-X main.Version=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name }}" -o GoReSym.exe
2723
Compress-Archive -DestinationPath GoReSym-windows.zip -LiteralPath ./GoReSym.exe -CompressionLevel Fastest
2824
Remove-Item ./GoReSym.exe
2925
- name: Linux Build
3026
run: |
3127
$Env:GOOS='linux'
32-
go build -ldflags="-X main.Version=${{ steps.get-tag.outputs.tag }}" -o GoReSym
28+
go build -ldflags="-X main.Version=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name }}" -o GoReSym
3329
Compress-Archive -DestinationPath GoReSym-linux.zip -LiteralPath ./GoReSym -CompressionLevel Fastest
3430
Remove-Item ./GoReSym
3531
- name: Mac Build
3632
run: |
3733
$Env:GOOS='darwin'
38-
go build -ldflags="-X main.Version=${{ steps.get-tag.outputs.tag }}" -o GoReSym
34+
go build -ldflags="-X main.Version=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name }}" -o GoReSym
3935
Compress-Archive -DestinationPath GoReSym-mac.zip -LiteralPath ./GoReSym -CompressionLevel Fastest
4036
Remove-Item ./GoReSym
41-
- name: Release Windows
42-
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # 2.3.2
43-
if: startsWith(github.ref, 'refs/tags/')
44-
with:
45-
files: GoReSym-windows.zip
46-
- name: Release Linux
47-
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # 2.3.2
48-
if: startsWith(github.ref, 'refs/tags/')
49-
with:
50-
files: GoReSym-linux.zip
51-
- name: Release Mac
52-
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # 2.3.2
37+
- name: Release
38+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.0.4
5339
if: startsWith(github.ref, 'refs/tags/')
5440
with:
55-
files: GoReSym-mac.zip
41+
files: |
42+
GoReSym-windows.zip
43+
GoReSym-linux.zip
44+
GoReSym-mac.zip

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ func main() {
434434
flag.Parse()
435435

436436
if *about {
437-
fmt.Printf("Version: %s", Version)
437+
fmt.Printf("Version: %s\n", Version)
438438
fmt.Println("GoReSym is a Golang symbol recovery tool by Google's Mandiant FLARE team. Maintained by Stephen Eckels.")
439439
fmt.Println("LICENSE MIT: https://github.com/mandiant/GoReSym/blob/master/LICENSE")
440440
fmt.Println("Dependencies:")

0 commit comments

Comments
 (0)