Skip to content

Merge pull request #5 from JacquesBeets/feature/tray-ui #6

Merge pull request #5 from JacquesBeets/feature/tray-ui

Merge pull request #5 from JacquesBeets/feature/tray-ui #6

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 service binary
run: |
$env:CGO_ENABLED=1
go build -o WinSenseConnect.exe ./cmd/service
- name: Build Go systray binary
run: |
$env:CGO_ENABLED=1
go build -o WinSenseConnectSystray.exe ./cmd/systray -ldflags "-H=windowsgui"
- 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 WinSenseConnectSystray.exe release\
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