-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (114 loc) · 3.56 KB
/
client.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Check out winrt-go fork
uses: actions/checkout@v4
with:
repository: balazsgrill/winrt-go
path: winrt-go
- name: Get release info
id: release_info
if: github.ref_type == 'tag'
uses: revam/gh-action-get-tag-and-version@v1
with:
tag: ${{ github.ref }}
prefix: v
prefixRegex: "[vV]?"
- id: set_version
uses: marcdomain/[email protected]
name: Set version
with:
variables: |
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
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Get tools
run: |
go install github.com/akavel/rsrc@latest
go install github.com/minio/minio@latest
go install github.com/minio/mc@latest
wget -o "${{ env.GOBIN}}\thrift.exe" https://dlcdn.apache.org/thrift/0.21.0/thrift-0.21.0.exe
- name: Test
run: go test -v ./...
- name: Generate
run: go generate ./...
- name: Set version to manifest
uses: rvolo/[email protected]
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
- name: Compress
uses: crazy-max/ghaction-upx@v3
with:
version: latest
files: |
./potatodrive.exe
args: -9
- uses: actions/upload-artifact@v4
with:
name: potatodrive.exe
path: potatodrive.exe
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 5.x
- name: Install wix
run: |
dotnet tool install --global wix
- name: Substitute version
uses: bluwy/substitute-string-action@v3
with:
_input-file: PotatoDrive-vars.wxi.tpl
_output-file: PotatoDrive-vars.wxi
_format-key: '%%key%%'
Version: ${{ env.VERSION}}
- uses: actions/upload-artifact@v4
with:
name: PotatoDrive-vars.wxi
path: PotatoDrive-vars.wxi
- name: Create installer
run: wix build PotatoDrive.wxs -arch x64
- uses: actions/upload-artifact@v4
with:
name: PotatoDrive_${{ env.VERSION}}.msi
path: PotatoDrive.msi
- name: release
uses: ncipollo/release-action@v1
id: create_release
if: github.ref_type == 'tag'
with:
allowUpdates: true
draft: false
prerelease: false
name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload Installer
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PotatoDrive.msi
asset_name: PotatoDrive-${{ env.VERSION }}.msi
asset_content_type: application/x-msi