2021-06-10 09:22:22 +00:00
|
|
|
name: Upload Release Asset
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*' # "e.g. v0.4"
|
|
|
|
|
|
|
|
workflow_dispatch:
|
2023-07-31 13:04:46 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
NPROC: 2
|
|
|
|
|
2021-06-10 09:22:22 +00:00
|
|
|
jobs:
|
|
|
|
build-and-upload:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-10-15 18:31:38 +00:00
|
|
|
os: [ubuntu-22.04, macos-13]
|
2023-06-06 15:41:41 +00:00
|
|
|
arch: [amd64]
|
|
|
|
include:
|
2024-04-26 07:02:58 +00:00
|
|
|
- os: macos-13
|
2023-06-06 15:41:41 +00:00
|
|
|
arch: arm64
|
|
|
|
runs-on: ${{ matrix.os }}
|
2021-06-10 09:22:22 +00:00
|
|
|
timeout-minutes: 60
|
|
|
|
|
2023-07-31 13:04:46 +00:00
|
|
|
name: ${{ matrix.os }} - ${{ matrix.arch }}
|
2021-06-10 09:22:22 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2023-05-16 07:11:41 +00:00
|
|
|
- name: Get submodules hash
|
|
|
|
id: submodules
|
2021-06-10 09:22:22 +00:00
|
|
|
run: |
|
2023-05-17 13:42:00 +00:00
|
|
|
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
|
2023-05-16 07:11:41 +00:00
|
|
|
|
|
|
|
- name: Cache submodules
|
|
|
|
uses: actions/cache@v3
|
2021-06-10 09:22:22 +00:00
|
|
|
with:
|
2023-05-16 07:11:41 +00:00
|
|
|
path: |
|
|
|
|
vendor/
|
|
|
|
.git/modules
|
2023-06-06 15:41:41 +00:00
|
|
|
key: ${{ runner.os }}-${{matrix.arch}}-submodules-${{ steps.submodules.outputs.hash }}
|
|
|
|
|
|
|
|
- name: prep variables
|
|
|
|
id: vars
|
|
|
|
run: |
|
2023-09-11 06:32:31 +00:00
|
|
|
NWAKU_ARTIFACT_NAME=$(echo "nwaku-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
2023-06-06 15:41:41 +00:00
|
|
|
|
|
|
|
echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
2021-06-10 09:22:22 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2023-06-06 15:41:41 +00:00
|
|
|
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
|
|
|
|
|
|
|
|
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" V=1 update
|
2023-09-26 08:11:38 +00:00
|
|
|
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC} -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" CI=false wakunode2
|
2023-06-06 15:41:41 +00:00
|
|
|
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
|
2024-09-24 11:30:49 +00:00
|
|
|
uses: actions/upload-artifact@v4.4.0
|
2021-06-10 09:22:22 +00:00
|
|
|
with:
|
2023-06-06 15:41:41 +00:00
|
|
|
name: ${{steps.vars.outputs.nwaku}}
|
|
|
|
path: ${{steps.vars.outputs.nwaku}}
|
2021-06-10 09:22:22 +00:00
|
|
|
if-no-files-found: error
|