Fix workflows #286
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: Build | |
on: | |
push: | |
branches: | |
- master | |
# repository_dispatch: | |
# types: [build] | |
workflow_dispatch: | |
jobs: | |
buildAndUnitTest: | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-latest, macos-latest ] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
SOLUTION_PATH: 'src/Blockcore.sln' | |
BUILD_CONFIGURATION: 'Release' | |
steps: | |
- uses: actions/checkout@v2 | |
name: Checkout | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
9.0.x | |
- name: Setup Node.js (16.x) | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
- name: Variables | |
run: | | |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV | |
shell: bash | |
- name: Unit Test | |
run: | | |
dotnet nuget locals all --clear | |
dotnet test -v=normal --filter "FullyQualifiedName!~IntegrationTests&Unstable!=True" -c ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}} | |
- name: Nuget Pack | |
run: dotnet pack --configuration ${{env.BUILD_CONFIGURATION}} --output "${{github.workspace}}/package/" ${{env.SOLUTION_PATH}} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Blockcore-${{env.VERSION}}-${{matrix.os}}-preview | |
path: "${{github.workspace}}/package/" | |
- name: Release | |
if: matrix.os == 'ubuntu-latest' | |
uses: sondreb/action-release@main | |
with: | |
commit: 'master' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
folder: "${{github.workspace}}/package/" | |
draft: true | |
prerelease: false | |
body: '' | |
name: "Blockcore ${{env.VERSION}}" | |
tag: ${{env.VERSION}} |