From 49d1f9d261367c296f806e72fa6ec90501913af4 Mon Sep 17 00:00:00 2001 From: Sora <45709238+sorabug@users.noreply.github.com> Date: Sun, 16 Apr 2023 09:16:54 +0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 758176f..6abcf4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: ChangeTimestamp +name: Build ChangeTimestamp on: push: @@ -24,16 +24,17 @@ jobs: dotnet-version: '4.0' - name: Restore NuGet packages - run: nuget restore ChangeTimestamp.sln + run: nuget restore ChangeTimestamp\ChangeTimestamp.sln - name: Build solution - run: msbuild.exe ChangeTimestamp.sln /t:Build /p:Configuration=${{ matrix.configuration }} + run: msbuild.exe ChangeTimestamp\ChangeTimestamp.sln /t:Build /p:Configuration=${{ matrix.configuration }} + + - name: Create NuGet package + run: nuget pack ChangeTimestamp\ChangeTimestamp.csproj -Properties Configuration=${{ matrix.configuration }} -OutputDirectory ./nuget - - name: Publish artifacts to Release branch - uses: actions/upload-artifact@v2 + - name: Publish NuGet package to GitHub Packages + uses: nuget/setup-nuget@v1 with: - name: ChangeTimestamp.exe - path: ChangeTimestamp/bin/${{ matrix.configuration }}/ChangeTimestamp.exe - if: success() - env: - GITHUB_REF: refs/heads/Release + nuget-api-key: ${{ secrets.GITHUB_TOKEN }} + nuget-version: ${{ github.ref }} + run: nuget push ./nuget/*.nupkg -Source "github"