name: Build and Release on: push: tags: - 'v*' jobs: build-and-publish: runs-on: ubuntu-latest permissions: contents: write packages: write steps: - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '10.0.x' - name: Extract version from tag id: version run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT - name: Build run: dotnet build SecretSecurity/SecretSecurity.csproj --configuration Release - name: Pack NuGet tool run: > dotnet pack SecretSecurity/SecretSecurity.csproj --configuration Release --no-build -p:Version=${{ steps.version.outputs.VERSION }} --output ./nupkg - name: Push to GitHub Packages run: > dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: files: ./nupkg/*.nupkg generate_release_notes: true