|
1 | 1 | name: Create Release |
2 | 2 |
|
3 | | -on: [workflow_dispatch] |
4 | | -jobs: |
5 | | - build: |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: publish-${{ github.ref }} |
| 8 | + cancel-in-progress: false |
6 | 9 |
|
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + publish: |
7 | 15 | runs-on: ubuntu-latest |
8 | 16 |
|
9 | 17 | steps: |
10 | | - - uses: actions/checkout@v3 |
| 18 | + - uses: actions/checkout@v5 |
11 | 19 | with: |
12 | 20 | fetch-depth: 0 |
13 | 21 |
|
14 | | - - name: Nerdbank.GitVersioning |
15 | | - uses: dotnet/nbgv@v0.4.0 |
16 | | - |
17 | 22 | - name: Setup .NET |
18 | | - uses: actions/setup-dotnet@v2 |
| 23 | + uses: actions/setup-dotnet@v4 |
19 | 24 | with: |
20 | | - dotnet-version: 8.0.x |
| 25 | + dotnet-version: 10.0.x |
21 | 26 |
|
22 | | - - uses: dotnet/nbgv@master |
| 27 | + - name: Cache NuGet packages |
| 28 | + uses: actions/cache@v4 |
| 29 | + with: |
| 30 | + path: ~/.nuget/packages |
| 31 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-nuget- |
| 34 | +
|
| 35 | + - name: Nerdbank.GitVersioning |
23 | 36 | id: nbgv |
24 | | - - run: echo 'SemVer2=${{ steps.nbgv.outputs.SemVer2 }}' |
| 37 | + uses: dotnet/nbgv@v0.4.2 |
| 38 | + |
| 39 | + - name: Restore |
| 40 | + run: dotnet restore |
25 | 41 |
|
26 | | - - name: Dotnet Pack |
27 | | - working-directory: src/TabBlazor.FluentValidation |
28 | | - run: dotnet pack -c Release |
| 42 | + - name: Build |
| 43 | + run: dotnet build --configuration Release --no-restore |
| 44 | + |
| 45 | + - name: Pack |
| 46 | + run: dotnet pack src/TabBlazor.FluentValidation/TabBlazor.FluentValidation.csproj --configuration Release --no-build --output ./artifacts |
| 47 | + |
| 48 | + - name: Upload package artifact |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: nupkg |
| 52 | + path: ./artifacts/*.nupkg |
29 | 53 |
|
30 | | - - name: Dotnet Nuget Push |
31 | | - working-directory: src/TabBlazor.FluentValidation/bin/Release |
32 | | - run: dotnet nuget push TabBlazor.FluentValidation.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} |
| 54 | + - name: Push to NuGet |
| 55 | + run: dotnet nuget push "./artifacts/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate |
33 | 56 |
|
34 | | - - name: Create Release |
35 | | - uses: actions/create-release@master |
36 | | - env: |
37 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + - name: Create GitHub Release |
| 58 | + uses: softprops/action-gh-release@v2 |
38 | 59 | with: |
39 | | - tag_name: ${{ steps.nbgv.outputs.SemVer2 }} |
40 | | - release_name: Release ${{ steps.nbgv.outputs.SemVer2 }} |
| 60 | + tag_name: v${{ steps.nbgv.outputs.SemVer2 }} |
| 61 | + name: Release ${{ steps.nbgv.outputs.SemVer2 }} |
41 | 62 | draft: false |
42 | | - prerelease: true |
| 63 | + prerelease: ${{ contains(steps.nbgv.outputs.SemVer2, '-') }} |
| 64 | + generate_release_notes: true |
| 65 | + files: ./artifacts/*.nupkg |
0 commit comments