Merge pull request #3 from JacquesBeets:feature/sqlite-2 #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |