Merge pull request #127 from x42protocol/mac_os_build #266
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 | |
jobs: | |
buildTestRelease: | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-latest, macos-11 ] | |
include: | |
- os: windows-latest | |
extension: ".exe" | |
bc_extension: ".zip" | |
platform: "win" | |
- os: ubuntu-latest | |
extension: ".deb" | |
bc_extension: ".tar.gz" | |
platform: "linux" | |
- os: macos-11 | |
extension: ".dmg" | |
bc_extension: ".zip" | |
platform: "mac" | |
node_version: [14.x] | |
dotnet_version: ['3.1.412'] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
UI_PATH: './xCore.UI/' | |
ARCH: 'x64' | |
steps: | |
- uses: actions/checkout@v1 | |
name: Checkout | |
- name: Setup Node.js (${{ matrix.node_version }}) | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Package NPM Variables | |
run: | | |
cd ${{ env.UI_PATH }} | |
echo NAME=$(npm run name --silent) >> $GITHUB_ENV | |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV | |
echo BLOCKCORE_DAEMON_VERSION=$(npm run blockcore_version --silent) >> $GITHUB_ENV | |
shell: bash | |
- name: Tooling | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt update | |
sudo apt install snapd | |
sudo snap install --classic snapcraft | |
- name: Download x42-BlockCore | |
shell: pwsh | |
run: | | |
cd ${{ env.UI_PATH }} | |
echo ${env:PATH} | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$url = "https://github.com/x42protocol/x42-BlockCore/releases/download/v${{ env.BLOCKCORE_DAEMON_VERSION }}/x42.Node-${{ env.BLOCKCORE_DAEMON_VERSION }}-${{ matrix.platform }}-${{ env.ARCH }}${{ matrix.bc_extension }}" | |
$output = Join-Path -Path "${{ env.UI_PATH }}" -ChildPath "daemon${{ matrix.bc_extension }}" | |
Write-Output "Url: $url" | |
Write-Output "Path: $output" | |
$start_time = Get-Date | |
(New-Object System.Net.WebClient).DownloadFile($url, $output) | |
Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)" | |
- name: Unpack (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
cd ${{ env.UI_PATH }} | |
7z x daemon${{ matrix.bc_extension }} -odaemon | |
- name: Unpack (Mac) | |
if: matrix.os == 'macos-11' | |
run: | | |
cd ${{ env.UI_PATH }} | |
unzip -a daemon${{ matrix.bc_extension }} -d daemon | |
- name: Unpack (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd ${{ env.UI_PATH }} | |
mkdir daemon | |
tar -xvzf daemon${{ matrix.bc_extension }} -C daemon | |
- name: Install (npm) | |
run: | | |
cd ${{ env.UI_PATH }} | |
npm install | |
- name: Publish (npm) | |
run: | | |
cd ${{ env.UI_PATH }} | |
npm run publish:${{ matrix.platform }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |