Update README.md #181
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: [publish-nodes] | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-latest, macos-latest ] | |
chain: ['MULTI', 'BTC', 'CRS'] | |
include: | |
- chain: MULTI | |
name: "MULTI" | |
solution: "MULTI/Blockcore.MultiNode.sln" | |
project: "MULTI/src/Blockcore.MultiNode/Blockcore.MultiNode.csproj" | |
- chain: BTC | |
name: "BTC" | |
solution: "BTC/Bitcoin.sln" | |
project: "BTC/src/Bitcoin.Node/Bitcoin.Node.csproj" | |
- chain: CRS | |
name: "CRS" | |
solution: "CRS/Cirrus.sln" | |
project: "CRS/Cirrus.Node/Cirrus.Node.csproj" | |
- os: windows-latest | |
extension: ".zip" | |
runtime: "win-x64" | |
- os: ubuntu-latest | |
extension: ".tar.gz" | |
runtime: "linux-x64" | |
- os: macos-latest | |
runtime: "osx-x64" | |
extension: ".zip" | |
node_version: [18] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
PROJECT_NAME: '${{ matrix.name }}' | |
SOLUTION_PATH: '${{ matrix.solution }}' | |
PROJECT_PATH: '${{ matrix.project }}' | |
BUILD_CONFIGURATION: 'Release' | |
steps: | |
- uses: actions/checkout@v1 | |
name: Checkout | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
8.0.x | |
- name: Setup Node.js (${{ matrix.node_version }}) | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Variables | |
run: | | |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV | |
shell: bash | |
# - name: Setup .NET | |
# uses: actions/setup-dotnet@v1 | |
# with: | |
# dotnet-version: 3.1.101 | |
- name: Restore | |
run: dotnet restore ${{env.SOLUTION_PATH}} | |
# - name: Build | |
# run: dotnet build -c ${{env.BUILD_CONFIGURATION}} -r ${{matrix.runtime}} -v m ${{env.SOLUTION_PATH}} | |
- name: Publish | |
run: dotnet publish -c ${{env.BUILD_CONFIGURATION}} -r ${{matrix.runtime}} -v m -o ./bin/publish ${{env.PROJECT_PATH}} | |
- name: Package Name | |
run: | | |
echo RELEASE_NAME=${{ env.PROJECT_NAME }}-${{ env.VERSION }}-${{ matrix.runtime }}${{ matrix.extension }} >> $GITHUB_ENV | |
echo RELEASE_PATH=${{ env.PROJECT_NAME }}-${{ env.VERSION }}-${{ matrix.runtime }}${{ matrix.extension }} >> $GITHUB_ENV | |
shell: bash | |
- name: Package (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
echo RELEASE_PATH=./bin/publish/${{env.RELEASE_NAME}} >> $GITHUB_ENV | |
cd ./bin/publish/ | |
tar cvzf ${{env.RELEASE_NAME}} * | |
- name: Package (Windows) | |
if: matrix.os == 'windows-latest' | |
run: Compress-Archive -Path .\bin\publish\* -DestinationPath .\${{env.RELEASE_NAME}} | |
- name: Package (Mac) | |
if: matrix.os == 'macos-latest' | |
run: zip -r ${{env.RELEASE_NAME}} ./bin/publish/ | |
- name: Release | |
uses: sondreb/action-release@main | |
with: | |
commit: 'master' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: "${{env.RELEASE_PATH}}" | |
draft: true | |
prerelease: false | |
body: '' | |
name: "Blockcore Reference Nodes (Release ${{env.VERSION}})" | |
tag: ${{env.VERSION}} |