FileSqlServerSync/.github/workflows/build.yaml

56 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2024-10-12 14:55:22 +00:00
name: buildProject
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
2024-10-13 03:56:54 +00:00
- name: Setup NodeJs
2024-10-12 14:55:22 +00:00
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: build
run: |
2024-10-13 03:56:54 +00:00
mkdir release
mkdir release/LocalServer/wwwroot
mkdir release/RemoteServer
mkdir release/JsScript
2024-10-12 14:55:22 +00:00
cd Tool/webtool
npm install
npm run build
cd ../../Server
dotnet restore
cd LocalServer
2024-10-13 03:56:54 +00:00
dotnet publish -o ../../release/Localserver --no-restore
2024-10-12 14:55:22 +00:00
cd ../RemoteServer
2024-10-13 03:56:54 +00:00
dotnet publish -o ../../release/RemoteServer --no-restore
2024-10-12 14:55:22 +00:00
cd ../../
- name: Package
run: |
2024-10-13 03:56:54 +00:00
cp Tool/JsScript/* release/JsScript/
2024-10-12 14:55:22 +00:00
Compress-Archive -Path "release/*" -DestinationPath "FS_win_dotnet8.zip" -Force
2024-10-18 04:42:03 +00:00
$version = $env:GITHUB_REF -replace 'refs/tags/', ''
Write-Host "VERSION=$version" >> $env:GITHUB_ENV
2024-10-12 14:55:22 +00:00
- name: Release
uses: softprops/action-gh-release@v2
2024-10-18 04:44:05 +00:00
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
FS_win_dotnet8.zip
LICENSE
name: ${{ env.VERSION}}
draft: false
prerelease: true