From 1e905371fbc1d7b3b9c267aac9ee27e32b01343a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Grill?= Date: Sat, 31 Aug 2024 15:58:53 +0200 Subject: [PATCH] propagate version into manifest --- .github/workflows/go.yml | 11 +++++++++-- cmd/main/main.exe.manifest | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0701b67..f3c30c8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -39,7 +39,7 @@ jobs: name: Set version with: variables: | - VERSION: '${{ github.ref_type }}' == 'tag' ? "${{ steps.release_info.outputs.version }}" : "0.0.0-dev" + VERSION: '${{ github.ref_type }}' == 'tag' ? "${{ steps.release_info.outputs.version }}" : "0.0.0.0" - name: enable Projection FS run: Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart @@ -59,8 +59,15 @@ jobs: - name: Generate run: go generate ./... + - name: Set logback env values + uses: rvolo/xml-replace-action@v0.2 + with: + filepath: "cmd/main/main.exe.manifest" + xpath: "//assembly/assemblyIdentity/@version" + replace: "${{ env.VERSION }}" + - name: Build - run: go build -o potatodrive.exe -ldflags="-H windowsgui -X 'main.Version=${{ env.VERSION}}'" ./cmd/main + run: go build -o potatodrive.exe -ldflags="-H windowsgui -X 'main.Version=${{ env.VERSION }}'" ./cmd/main - name: Compress uses: crazy-max/ghaction-upx@v3 with: diff --git a/cmd/main/main.exe.manifest b/cmd/main/main.exe.manifest index 8acf1c9..06ce1c4 100644 --- a/cmd/main/main.exe.manifest +++ b/cmd/main/main.exe.manifest @@ -1,6 +1,6 @@ - +