v4.1.2022.0501
大石头 编写于 2022-05-01 10:20:53
NewLife.Redis
name: publish

on:
  push:
    tags: [ v* ]
  workflow_dispatch:

jobs:
  build-publish:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v2
      with:
        dotnet-version: 6.0.x
    - name: Restore
      run: |
        dotnet restore NewLife.Redis/NewLife.Redis.csproj
        dotnet restore NewLife.Extensions.Caching.Redis/NewLife.Extensions.Caching.Redis.csproj
    - name: Build
      run: |
        dotnet pack --no-restore --version-suffix $(date "+%Y.%m%d") -c Release -o out NewLife.Redis/NewLife.Redis.csproj
        dotnet pack --no-restore --version-suffix $(date "+%Y.%m%d") -c Release -o out NewLife.Extensions.Caching.Redis/NewLife.Extensions.Caching.Redis.csproj
    - name: Publish
      run: |
        # dotnet nuget push ./out/*.nupkg --skip-duplicate --source https://nuget.pkg.github.com/NewLifeX/index.json --api-key ${{ github.token }}
        dotnet nuget push ./out/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.nugetKey }}