Repository navigation
build: 版本升至 1.0.1(内嵌 README) #4
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
| # 打标签 v* 时:构建 + 测试 + 打包,创建 GitHub Release 并附 nupkg/snupkg。 | |
| name: release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Build | |
| run: dotnet build StreamFrame.slnx -c Release | |
| - name: Test | |
| run: dotnet test StreamFrame.slnx -c Release --no-build | |
| - name: Pack | |
| run: | | |
| dotnet pack src/StreamFrame/StreamFrame.csproj -c Release --no-build -o artifacts | |
| dotnet pack src/StreamFrame.Protocols.Xml/StreamFrame.Protocols.Xml.csproj -c Release --no-build -o artifacts | |
| - name: Extract tag version | |
| id: tag | |
| run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| artifacts/*.nupkg | |
| artifacts/*.snupkg |