Update build.yml #10
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: build | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup build | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration Release | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Pack the project | |
run: dotnet pack --configuration Release --include-symbols --output ./bin/Release/net6.0 /p:SymbolPackageFormat=snupkg | |
- name: Create source code archive | |
run: | | |
cd ./ | |
tar -czvf source.tar.gz . | |
zip -r source.zip . | |
working-directory: ./ | |
- name: Upload release assets | |
uses: actions/upload-release-asset@v1 | |
with: | |
asset_path: | | |
./bin/Release/net6.0/*.nupkg | |
./bin/Release/net6.0/*.snupkg | |
./Src/NanoRabbit/source.tar.gz | |
./Src/NanoRabbit/source.zip | |
asset_name: ${{ github.repository }} ${GITHUB_REF##*/} build artifacts | |
asset_content_type: application/zip | |
tag_name: ${{ github.ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |