From 4e5bdab6b836bbfaebb00a18dbe7d3f3cf74bcc8 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Thu, 30 Jul 2020 14:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9E=84=E5=BB=BA=E7=BC=93?= =?UTF-8?q?=E5=AD=98Nuget=E5=8C=85=20=E8=AE=A1=E7=AE=97=E4=B8=BB=E7=A8=8B?= =?UTF-8?q?=E5=BA=8FSHA256?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d085b4d3..a918b01d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,10 +5,10 @@ jobs: name: Build runs-on: windows-latest steps: - - name: NuGet + - name: Setup NuGet uses: nuget/setup-nuget@v1 - - name: MSBuild + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.0.0 - name: Checkout @@ -17,6 +17,14 @@ jobs: - name: Update submodules uses: snickerbockers/submodules-init@v4 + - name: Restore NuGet Packages Cache + uses: actions/cache@v2 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('Netch/Netch.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- + - name: Restore NuGet Package run: nuget restore Netch.sln @@ -27,13 +35,14 @@ jobs: New-Item -ItemType Directory -Path C:\builtfiles -Force > $null Compress-Archive -Path Netch\bin\x64\Release\win-x64\* -DestinationPath C:\builtfiles\Netch.zip echo "::set-env name=Netch_SHA256::$(.\GetSHA256.ps1 C:\builtfiles\Netch.zip)" + echo "::set-env name=Netch_EXE_SHA256::$(.\GetSHA256.ps1 Netch\bin\x64\Release\win-x64\Netch.exe)" - name: Upload uses: actions/upload-artifact@v1 with: name: Netch path: Netch\bin\x64\Release\win-x64 - + - name: Release uses: softprops/action-gh-release@v1 env: @@ -55,3 +64,22 @@ jobs: | 文件名 | SHA256 | | :- | :- | | Netch.zip | ${{ env.Netch_SHA256 }} | + + # Deploy: + # needs: [build] + # runs-on: ubuntu-latest + # steps: + # - name: Download Artifacts + # uses: actions/download-artifact@v1 + # with: + # name: Netch + + # - name: Pushes to another repository + # uses: peaceiris/actions-gh-pages@v3 + # with: + # personal_token: ${{ secrets.ACCESS_TOKEN }} + # publish_branch: repo + # publish_dir: ./Netch + # external_repository: ${{ github.repository_owner }}/NetchReleases + # user_name: 'github-actions[bot]' + # user_email: 'github-actions[bot]@users.noreply.github.com'