chore: specify project path for restore and build commands #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to NuGet | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| changelog: | |
| name: Generate Changelog | |
| uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main | |
| publish: | |
| name: Build and Publish | |
| runs-on: windows-latest | |
| needs: changelog | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| $tag = "${{ github.ref_name }}" | |
| $version = $tag -replace '^v', '' | |
| echo "VERSION=$version" >> $env:GITHUB_OUTPUT | |
| echo "TAG=$tag" >> $env:GITHUB_OUTPUT | |
| shell: pwsh | |
| - name: Restore dependencies | |
| run: dotnet restore src/CodingWithCalvin.Otel4Vsix/CodingWithCalvin.Otel4Vsix.csproj | |
| - name: Build | |
| run: dotnet build src/CodingWithCalvin.Otel4Vsix/CodingWithCalvin.Otel4Vsix.csproj --configuration Release --no-restore -p:Version=${{ steps.version.outputs.VERSION }} | |
| - name: Pack | |
| run: dotnet pack src/CodingWithCalvin.Otel4Vsix/CodingWithCalvin.Otel4Vsix.csproj --configuration Release --no-build -p:Version=${{ steps.version.outputs.VERSION }} --output ./nupkg | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.TAG }} | |
| name: v${{ steps.version.outputs.VERSION }} | |
| body: ${{ needs.changelog.outputs.changelog }} | |
| draft: false | |
| prerelease: ${{ contains(steps.version.outputs.VERSION, '-') }} | |
| files: | | |
| ./nupkg/*.nupkg | |
| # Get a short-lived NuGet API key | |
| - name: NuGet login (OIDC → temp API key) | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USERNAME }} | |
| - name: Push to NuGet | |
| run: | | |
| Get-ChildItem ./nupkg/*.nupkg | ForEach-Object { | |
| dotnet nuget push $_.FullName --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| } | |
| shell: pwsh | |
| post-bluesky: | |
| name: Post to BlueSky | |
| needs: publish | |
| uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main | |
| with: | |
| post_text: | | |
| 🔭 CodingWithCalvin.Otel4Vsix ${{ github.ref_name }} has been released! | |
| Add OpenTelemetry observability to your Visual Studio extensions in minutes! | |
| 📦 [NuGet](https://www.nuget.org/packages/CodingWithCalvin.Otel4Vsix) | |
| 📝 [Release Notes](https://github.com/CodingWithCalvin/Otel4Vsix/releases/tag/${{ github.ref_name }}) | |
| #dotnet #visualstudio #opentelemetry #vsix #nuget | |
| embed_url: https://github.com/CodingWithCalvin/Otel4Vsix/releases/tag/${{ github.ref_name }} | |
| embed_title: "Otel4Vsix ${{ github.ref_name }}" | |
| embed_description: "OpenTelemetry support library for Visual Studio 2022+ extensions" | |
| secrets: | |
| BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }} | |
| BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }} | |
| post-linkedin: | |
| name: Post to LinkedIn | |
| needs: publish | |
| uses: CodingWithCalvin/.github/.github/workflows/linkedin-post.yml@main | |
| with: | |
| post_text: | | |
| 🔭 CodingWithCalvin.Otel4Vsix ${{ github.ref_name }} has been released! | |
| Add OpenTelemetry observability to your Visual Studio extensions in minutes! | |
| 📦 NuGet: https://www.nuget.org/packages/CodingWithCalvin.Otel4Vsix | |
| 📝 Release Notes: https://github.com/CodingWithCalvin/Otel4Vsix/releases/tag/${{ github.ref_name }} | |
| #dotnet #visualstudio #opentelemetry #vsix #nuget | |
| article_url: https://github.com/CodingWithCalvin/Otel4Vsix/releases/tag/${{ github.ref_name }} | |
| article_title: "Otel4Vsix ${{ github.ref_name }}" | |
| article_description: "OpenTelemetry support library for Visual Studio 2022+ extensions" | |
| secrets: | |
| LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }} | |
| LINKEDIN_CLIENT_ID: ${{ secrets.LINKEDIN_CLIENT_ID }} |