Publish Release #5
This file contains 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 Release | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
publish: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: msbuild /m /p:Configuration=Release | |
- name: Pack NuGet package | |
run: dotnet pack ./src/StyleCopPlus/StyleCopPlus.csproj --configuration Release | |
- name: Publish NuGet package | |
run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Get version number | |
id: get-version | |
run: Set-Content '$GITHUB_OUTPUT' -Value "VERSION=$(git describe --abbrev=0)" | |
- name: Publish VSIX package | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.get-version.outputs.VERSION }} | |
files: ./src/StyleCopPlus.Vsix/bin/Release/net472/StyleCopPlusVsix.vsix | |
name: ${{ steps.get-version.outputs.VERSION }} |