diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a603781..42f2d95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 6.x - name: Build and Test run: ./build.ps1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..327dd69 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: release +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.x + + - run: dotnet pack src/yunit -c Release /p:Version=${GITHUB_REF_NAME#v} -o drop/nuget + + - uses: actions/upload-artifact@v3 + with: + name: nuget + path: drop/nuget + + - run: dotnet nuget push drop/nuget/*.nupkg --api-key "${{ secrets.NUGET_KEY }}" --skip-duplicate --source https://api.nuget.org/v3/index.json diff --git a/Directory.Build.props b/Directory.Build.props index 4da0461..ed29407 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,5 +12,14 @@ Latest true + + true + true + snupkg + true + + + + \ No newline at end of file diff --git a/version.json b/version.json deleted file mode 100644 index bb4e978..0000000 --- a/version.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "1.0.0-preview.{height}", - "publicReleaseRefSpec": [ - "^refs/tags/v\\d+\\.\\d+$" - ] -} \ No newline at end of file