From 82bfb483c7b170b21b73b798a50adc41758c1ca6 Mon Sep 17 00:00:00 2001 From: nsnail Date: Thu, 14 Dec 2023 10:21:18 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20=E5=8F=91=E7=89=88?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=84=9A=E6=9C=AC=20(#18)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8ac362..156dfe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,50 @@ -# This workflow will build a .NET project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net - -name: CI \ No newline at end of file +name: CI +on: + push: + tags: + - v* +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + filter: tree:0 + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: ${{ runner.os }}-nuget + - working-directory: ./src/backend/Dot + run: dotnet publish Dot.csproj -f net8.0-windows -r win-x64 -c Release + - working-directory: ./src/backend/Dot + run: dotnet publish Dot.csproj -f net8.0 -r linux-x64 -c Release + - uses: actions/create-release@v1 + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/backend/Dot/bin/Release/net8.0-windows/win-x64/publish/dot.exe + asset_name: dot-win-x64.exe + asset_content_type: application/octet-stream + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/backend/Dot/bin/Release/net8.0/linux-x64/publish/dot + asset_name: dot-linux-x64 + asset_content_type: application/octet-stream \ No newline at end of file