-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.02 KB
/
build_and_release.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
name: Build and Release
on:
push:
branches:
- master
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set version
run: echo "VERSION=0.0.${{ github.run_number }}" >> $env:GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install MinGW-w64
run: |
choco install mingw -y
echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build Go binary
run: |
cd backend
$env:CGO_ENABLED=1
go build -o ../WinSenseConnect.exe
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Build Nuxt3 frontend
run: |
cd frontend
npm ci
npm run generate
- name: Package release
run: |
mkdir -p release/frontend/.output
mkdir release\scripts
copy WinSenseConnect.exe release\
copy config.template.json release\config.json
xcopy /E /I frontend\.output\public release\frontend\.output\public
copy scripts\test_notification.ps1 release\scripts\
- name: Zip Release
run: Compress-Archive -Path release -DestinationPath WinSenseConnect-v${{ env.VERSION }}.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./WinSenseConnect-v${{ env.VERSION }}.zip
asset_name: WinSenseConnect-v${{ env.VERSION }}.zip
asset_content_type: application/zip