2023-05-26 06:14:45 +00:00
|
|
|
name: Nightly Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: 13 3 * * *
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
|
|
|
RELEASE_NAME: nightly
|
|
|
|
|
|
|
|
NPROC: 2
|
|
|
|
MAKEFLAGS: "-j${NPROC}"
|
|
|
|
NIMFLAGS: "--parallelBuild:${NPROC}"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-publish:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest]
|
2023-05-26 10:07:40 +00:00
|
|
|
experimental: [true, false]
|
2023-06-06 15:41:41 +00:00
|
|
|
arch: [amd64]
|
|
|
|
include:
|
|
|
|
- os: macos-latest
|
|
|
|
experimental: false
|
|
|
|
arch: arm64
|
2023-05-26 06:14:45 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Get submodules hash
|
|
|
|
id: submodules
|
|
|
|
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
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
vendor/
|
|
|
|
.git/modules
|
2023-06-06 15:41:41 +00:00
|
|
|
key: ${{ runner.os }}-${{matrix.arch}}-submodules-${{ steps.submodules.outputs.hash }}
|
2023-05-26 06:14:45 +00:00
|
|
|
|
|
|
|
|
2023-05-26 10:07:40 +00:00
|
|
|
- name: prep variables
|
|
|
|
id: vars
|
2023-05-26 06:14:45 +00:00
|
|
|
run: |
|
2023-05-26 10:07:40 +00:00
|
|
|
EXPERIMENTAL=$([[ "${{ matrix.experimental }}" == "true" ]] && echo "-experimental" || echo "")
|
|
|
|
|
|
|
|
echo "experimental=${EXPERIMENTAL}" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-06-06 15:41:41 +00:00
|
|
|
NWAKU_ARTIFACT_NAME=$(echo "nwaku${EXPERIMENTAL}-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
|
|
|
NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools${EXPERIMENTAL}-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
2023-05-26 10:07:40 +00:00
|
|
|
|
|
|
|
echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
|
|
|
echo "nwakutools=${NWAKU_TOOLS_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
- name: build artifacts
|
|
|
|
id: build
|
|
|
|
run: |
|
2023-06-06 15:41:41 +00:00
|
|
|
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
|
|
|
|
|
|
|
|
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false EXPERIMENTAL=${{matrix.experimental}} NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" wakunode2 tools
|
2023-05-26 06:14:45 +00:00
|
|
|
|
2023-05-26 10:07:40 +00:00
|
|
|
tar -cvzf ${{steps.vars.outputs.nwaku}} ./build/wakunode2
|
|
|
|
tar -cvzf ${{steps.vars.outputs.nwakutools}} ./build/wakucanary ./build/networkmonitor
|
2023-05-26 06:14:45 +00:00
|
|
|
|
|
|
|
- name: upload artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: wakunode2
|
2023-05-26 10:07:40 +00:00
|
|
|
path: ${{steps.vars.outputs.nwaku}}
|
2023-05-26 06:14:45 +00:00
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
- name: upload artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: tools
|
2023-05-26 10:07:40 +00:00
|
|
|
path: ${{steps.vars.outputs.nwakutools}}
|
2023-05-26 06:14:45 +00:00
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
create-release-candidate:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [ build-and-publish ]
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: master
|
|
|
|
- name: download artifacts
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
- name: generate release notes
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
gh release view ${RELEASE_NAME} &>/dev/null &&\
|
|
|
|
gh release delete -y ${RELEASE_NAME} --cleanup-tag &&\
|
|
|
|
git tag -d ${RELEASE_NAME}
|
|
|
|
|
|
|
|
docker run \
|
|
|
|
-t \
|
|
|
|
--rm \
|
|
|
|
-v ${PWD}:/opt/sv4git/repo:z \
|
|
|
|
-u $(id -u) \
|
|
|
|
docker.io/wakuorg/sv4git:latest \
|
|
|
|
release-notes |\
|
|
|
|
sed -E 's@#([0-9]+)@[#\1](https://github.com/waku-org/nwaku/issues/\1)@g' > release_notes.md
|
|
|
|
|
|
|
|
sed -i "s/^## .*/Generated at $(date)/" release_notes.md
|
|
|
|
|
|
|
|
cat release_notes.md
|
|
|
|
|
|
|
|
gh release create ${RELEASE_NAME} --prerelease --target master \
|
|
|
|
--title ${RELEASE_NAME} --notes-file release_notes.md \
|
|
|
|
wakunode2/* tools/*
|