2023-06-08 15:13:40 +00:00
|
|
|
name: Pre-Release
|
2023-05-26 06:14:45 +00:00
|
|
|
|
|
|
|
on:
|
2023-06-08 15:13:40 +00:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*-rc.*'
|
2023-05-26 06:14:45 +00:00
|
|
|
schedule:
|
|
|
|
- cron: 13 3 * * *
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
|
|
|
RELEASE_NAME: nightly
|
|
|
|
|
|
|
|
NPROC: 2
|
|
|
|
MAKEFLAGS: "-j${NPROC}"
|
|
|
|
NIMFLAGS: "--parallelBuild:${NPROC}"
|
|
|
|
|
|
|
|
jobs:
|
2023-09-11 14:16:53 +00:00
|
|
|
tag-name:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Vars
|
|
|
|
id: vars
|
|
|
|
run: |
|
|
|
|
TAG=$([[ "${{github.ref}}" == "refs/heads/master" ]] && echo "${{env.RELEASE_NAME}}" || echo ${{github.ref}} | sed 's#refs/tags/##')
|
|
|
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
|
|
outputs:
|
|
|
|
tag: ${{steps.vars.outputs.tag}}
|
|
|
|
|
2023-05-26 06:14:45 +00:00
|
|
|
build-and-publish:
|
2023-09-11 14:16:53 +00:00
|
|
|
needs: tag-name
|
2023-05-26 06:14:45 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-26 07:02:58 +00:00
|
|
|
os: [ubuntu-latest, 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
|
2023-05-26 06:14:45 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-05-26 10:07:40 +00:00
|
|
|
- name: prep variables
|
|
|
|
id: vars
|
2023-05-26 06:14:45 +00:00
|
|
|
run: |
|
2023-06-08 15:13:40 +00:00
|
|
|
ARCH=${{matrix.arch}}
|
2023-05-26 10:07:40 +00:00
|
|
|
|
2023-06-08 15:13:40 +00:00
|
|
|
echo "arch=${ARCH}" >> $GITHUB_OUTPUT
|
2023-05-26 10:07:40 +00:00
|
|
|
|
2023-09-11 14:16:53 +00:00
|
|
|
NWAKU_ARTIFACT_NAME=$(echo "nwaku-${ARCH}-${{runner.os}}-${{ needs.tag-name.outputs.tag }}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
|
|
|
NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools-${ARCH}-${{runner.os}}-${{ needs.tag-name.outputs.tag }}.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
|
|
|
|
|
2023-06-08 15:13:40 +00:00
|
|
|
|
2023-05-26 10:07:40 +00:00
|
|
|
- name: build artifacts
|
|
|
|
id: build
|
|
|
|
run: |
|
2023-06-06 15:41:41 +00:00
|
|
|
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
|
|
|
|
|
2023-09-11 06:32:31 +00:00
|
|
|
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
|
2023-06-08 15:13:40 +00:00
|
|
|
update
|
|
|
|
|
2023-09-26 08:11:38 +00:00
|
|
|
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false\
|
|
|
|
NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}} -d:postgres" \
|
2023-06-08 15:13:40 +00:00
|
|
|
wakunode2\
|
|
|
|
chat2\
|
|
|
|
tools
|
2023-05-26 06:14:45 +00:00
|
|
|
|
2023-08-09 17:11:50 +00:00
|
|
|
tar -cvzf ${{steps.vars.outputs.nwaku}} ./build/wakunode2 ./build/chat2
|
2023-05-26 10:07:40 +00:00
|
|
|
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:
|
2023-08-30 15:29:41 +00:00
|
|
|
name: wakutools
|
2023-05-26 10:07:40 +00:00
|
|
|
path: ${{steps.vars.outputs.nwakutools}}
|
2023-05-26 06:14:45 +00:00
|
|
|
retention-days: 2
|
|
|
|
|
2023-09-11 14:16:53 +00:00
|
|
|
build-docker-image:
|
|
|
|
needs: tag-name
|
|
|
|
uses: waku-org/nwaku/.github/workflows/container-image.yml@master
|
|
|
|
with:
|
|
|
|
image_tag: ${{ needs.tag-name.outputs.tag }}
|
|
|
|
secrets: inherit
|
|
|
|
|
2023-09-21 09:56:04 +00:00
|
|
|
js-waku-node:
|
2023-09-11 14:16:53 +00:00
|
|
|
needs: build-docker-image
|
2023-09-21 09:56:04 +00:00
|
|
|
uses: waku-org/js-waku/.github/workflows/test-node.yml@master
|
2023-09-11 14:16:53 +00:00
|
|
|
with:
|
|
|
|
nim_wakunode_image: ${{ needs.build-docker-image.outputs.image }}
|
2023-09-21 09:56:04 +00:00
|
|
|
test_type: node
|
|
|
|
debug: waku*
|
|
|
|
|
|
|
|
js-waku-node-optional:
|
|
|
|
needs: build-docker-image
|
|
|
|
uses: waku-org/js-waku/.github/workflows/test-node.yml@master
|
|
|
|
with:
|
|
|
|
nim_wakunode_image: ${{ needs.build-docker-image.outputs.image }}
|
|
|
|
test_type: node-optional
|
|
|
|
debug: waku*
|
2023-09-11 14:16:53 +00:00
|
|
|
|
2023-05-26 06:14:45 +00:00
|
|
|
create-release-candidate:
|
|
|
|
runs-on: ubuntu-latest
|
2023-10-13 08:45:18 +00:00
|
|
|
needs: [ tag-name, build-and-publish ]
|
2023-05-26 06:14:45 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: master
|
2023-06-08 15:13:40 +00:00
|
|
|
|
2023-05-26 06:14:45 +00:00
|
|
|
- name: download artifacts
|
|
|
|
uses: actions/download-artifact@v2
|
2023-06-08 15:13:40 +00:00
|
|
|
|
|
|
|
- name: prep variables
|
|
|
|
id: vars
|
|
|
|
run: |
|
|
|
|
REF=$(echo ${{github.ref}} | sed 's#.*/##')
|
|
|
|
|
|
|
|
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-05-26 06:14:45 +00:00
|
|
|
- name: generate release notes
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
2023-06-08 15:13:40 +00:00
|
|
|
set -x
|
2023-09-11 14:16:53 +00:00
|
|
|
gh release view ${{ needs.tag-name.outputs.tag }} &>/dev/null &&\
|
|
|
|
gh release delete -y ${{ needs.tag-name.outputs.tag }} &&\
|
|
|
|
[[ "${{ needs.tag-name.outputs.tag }}" == "nightly" ]] && git tag -d ${{ needs.tag-name.outputs.tag }}
|
2023-06-08 15:13:40 +00:00
|
|
|
|
2023-09-11 14:16:53 +00:00
|
|
|
RELEASE_NOTES_TAG=$([[ "${{ needs.tag-name.outputs.tag }}" != "nightly" ]] && echo "-t ${{steps.vars.outputs.ref}}" || echo "")
|
2023-05-26 06:14:45 +00:00
|
|
|
|
|
|
|
docker run \
|
|
|
|
-t \
|
|
|
|
--rm \
|
|
|
|
-v ${PWD}:/opt/sv4git/repo:z \
|
|
|
|
-u $(id -u) \
|
|
|
|
docker.io/wakuorg/sv4git:latest \
|
2023-06-08 15:13:40 +00:00
|
|
|
release-notes ${RELEASE_NOTES_TAG} --previous $(git tag -l --sort -creatordate | grep -e "^v[0-9]*\.[0-9]*\.[0-9]*$") |\
|
2023-05-26 06:14:45 +00:00
|
|
|
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
|
|
|
|
|
2023-09-11 14:16:53 +00:00
|
|
|
TARGET=$([[ "${{ needs.tag-name.outputs.tag }}" == "nightly" ]] && echo "--target ${{steps.vars.outputs.ref}}" || echo "")
|
2023-06-08 15:13:40 +00:00
|
|
|
|
2023-09-11 14:16:53 +00:00
|
|
|
gh release create ${{ needs.tag-name.outputs.tag }} --prerelease ${TARGET} \
|
|
|
|
--title ${{ needs.tag-name.outputs.tag }} --notes-file release_notes.md \
|
2023-08-30 15:29:41 +00:00
|
|
|
wakunode2/* wakutools/*
|