nwaku/.github/workflows/release-assets.yml

68 lines
2.2 KiB
YAML
Raw Normal View History

2021-06-10 09:22:22 +00:00
name: Upload Release Asset
on:
push:
tags:
- 'v*' # "e.g. v0.4"
workflow_dispatch:
jobs:
build-and-upload:
strategy:
matrix:
env:
- { NPROC: 2 }
os: [ubuntu-latest, macos-latest]
arch: [amd64]
include:
- os: macos-latest
experimental: false
arch: arm64
runs-on: ${{ matrix.os }}
2021-06-10 09:22:22 +00:00
env: ${{ matrix.env }}
timeout-minutes: 60
name: ${{ matrix.os }} - ${{ matrix.env.NPROC }} processes
2021-06-10 09:22:22 +00:00
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get submodules hash
id: submodules
2021-06-10 09:22:22 +00:00
run: |
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
- name: Cache submodules
uses: actions/cache@v3
2021-06-10 09:22:22 +00:00
with:
path: |
vendor/
.git/modules
key: ${{ runner.os }}-${{matrix.arch}}-submodules-${{ steps.submodules.outputs.hash }}
- name: prep variables
id: vars
run: |
NWAKU_ARTIFACT_NAME=$(echo "nwaku${EXPERIMENTAL}-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
2021-06-10 09:22:22 +00:00
- name: Install dependencies
run: |
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" V=1 update
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" CI=false wakunode1
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" CI=false wakunode2
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" CI=false chat2
tar -cvzf ${{steps.vars.outputs.nwaku}} ./build/
2021-06-10 09:22:22 +00:00
- name: Upload asset
uses: actions/upload-artifact@v2.2.3
with:
name: ${{steps.vars.outputs.nwaku}}
path: ${{steps.vars.outputs.nwaku}}
2021-06-10 09:22:22 +00:00
if-no-files-found: error