1616 NIMFLAGS : " --parallelBuild:${NPROC}"
1717
1818jobs :
19+ tag-name :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v3
24+
25+ - name : Vars
26+ id : vars
27+ run : |
28+ TAG=$([[ "${{github.ref}}" == "refs/heads/master" ]] && echo "${{env.RELEASE_NAME}}" || echo ${{github.ref}} | sed 's#refs/tags/##')
29+ echo "tag=${TAG}" >> $GITHUB_OUTPUT
30+ outputs :
31+ tag : ${{steps.vars.outputs.tag}}
32+
1933 build-and-publish :
34+ needs : tag-name
2035 strategy :
2136 matrix :
2237 os : [ubuntu-latest, macos-latest]
@@ -33,12 +48,11 @@ jobs:
3348 id : vars
3449 run : |
3550 ARCH=${{matrix.arch}}
36- TAG=$([[ "${{github.ref}}" == "refs/heads/master" ]] && echo "${{env.RELEASE_NAME}}" || echo ${{github.ref}} | sed 's#refs/tags/##')
3751
3852 echo "arch=${ARCH}" >> $GITHUB_OUTPUT
3953
40- NWAKU_ARTIFACT_NAME=$(echo "nwaku-${ARCH}-${{runner.os}}-${TAG }.tar.gz" | tr "[:upper:]" "[:lower:]")
41- NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools-${ARCH}-${{runner.os}}-${TAG }.tar.gz" | tr "[:upper:]" "[:lower:]")
54+ NWAKU_ARTIFACT_NAME=$(echo "nwaku-${ARCH}-${{runner.os}}-${{ needs.tag-name.outputs.tag } }.tar.gz" | tr "[:upper:]" "[:lower:]")
55+ NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools-${ARCH}-${{runner.os}}-${{ needs.tag-name.outputs.tag } }.tar.gz" | tr "[:upper:]" "[:lower:]")
4256
4357 echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
4458 echo "nwakutools=${NWAKU_TOOLS_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
5771 chat2\
5872 tools
5973
60-
61-
6274 tar -cvzf ${{steps.vars.outputs.nwaku}} ./build/wakunode2 ./build/chat2
6375 tar -cvzf ${{steps.vars.outputs.nwakutools}} ./build/wakucanary ./build/networkmonitor
6476
7688 path : ${{steps.vars.outputs.nwakutools}}
7789 retention-days : 2
7890
91+ build-docker-image :
92+ needs : tag-name
93+ uses : waku-org/nwaku/.github/workflows/container-image.yml@master
94+ with :
95+ image_tag : ${{ needs.tag-name.outputs.tag }}
96+ secrets : inherit
97+
98+ js-waku :
99+ needs : build-docker-image
100+ uses : waku-org/js-waku/.github/workflows/ci.yml@master
101+ with :
102+ nim_wakunode_image : ${{ needs.build-docker-image.outputs.image }}
103+ caller : nwaku
104+
79105 create-release-candidate :
80106 runs-on : ubuntu-latest
81- needs : [ build-and-publish ]
107+ needs : [ tag-name, build-and-publish ]
82108 steps :
83109 - name : Checkout code
84110 uses : actions/checkout@v3
@@ -92,22 +118,20 @@ jobs:
92118 - name : prep variables
93119 id : vars
94120 run : |
95- RELEASE=$([[ "${{github.ref}}" == "refs/heads/master" ]] && echo "${{env.RELEASE_NAME}}" || echo ${{github.ref}} | sed 's#refs/tags/##')
96121 REF=$(echo ${{github.ref}} | sed 's#.*/##')
97122
98- echo "release=${RELEASE}" >> $GITHUB_OUTPUT
99123 echo "ref=${REF}" >> $GITHUB_OUTPUT
100124
101125 - name : generate release notes
102126 env :
103127 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104128 run : |
105129 set -x
106- gh release view ${{steps.vars .outputs.release }} &>/dev/null &&\
107- gh release delete -y ${{steps.vars .outputs.release }} &&\
108- [[ "${{steps.vars .outputs.release }}" == "nightly" ]] && git tag -d ${{steps.vars .outputs.release }}
130+ gh release view ${{ needs.tag-name .outputs.tag }} &>/dev/null &&\
131+ gh release delete -y ${{ needs.tag-name .outputs.tag }} &&\
132+ [[ "${{ needs.tag-name .outputs.tag }}" == "nightly" ]] && git tag -d ${{ needs.tag-name .outputs.tag }}
109133
110- RELEASE_NOTES_TAG=$([[ "${{steps.vars .outputs.release }}" != "nightly" ]] && echo "-t ${{steps.vars.outputs.ref}}" || echo "")
134+ RELEASE_NOTES_TAG=$([[ "${{ needs.tag-name .outputs.tag }}" != "nightly" ]] && echo "-t ${{steps.vars.outputs.ref}}" || echo "")
111135
112136 docker run \
113137 -t \
@@ -122,8 +146,8 @@ jobs:
122146
123147 cat release_notes.md
124148
125- TARGET=$([[ "${{steps.vars .outputs.release }}" == "nightly" ]] && echo "--target ${{steps.vars.outputs.ref}}" || echo "")
149+ TARGET=$([[ "${{ needs.tag-name .outputs.tag }}" == "nightly" ]] && echo "--target ${{steps.vars.outputs.ref}}" || echo "")
126150
127- gh release create ${{steps.vars .outputs.release }} --prerelease ${TARGET} \
128- --title ${{steps.vars .outputs.release }} --notes-file release_notes.md \
151+ gh release create ${{ needs.tag-name .outputs.tag }} --prerelease ${TARGET} \
152+ --title ${{ needs.tag-name .outputs.tag }} --notes-file release_notes.md \
129153 wakunode2/* wakutools/*
0 commit comments