Skip to content

Commit 8421240

Browse files
committed
chore(ci): add js-waku test to pre-release workflow (#2017)
1 parent 65eb438 commit 8421240

File tree

2 files changed

+44
-16
lines changed

2 files changed

+44
-16
lines changed

.github/workflows/container-image.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: container-image-build
22

33
on:
44
workflow_call:
5+
inputs:
6+
image_tag:
7+
type: string
8+
default: ${{ github.event.number }}
59
outputs:
610
image:
711
description: The resulting image link
@@ -60,7 +64,7 @@ jobs:
6064
env:
6165
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
6266
QUAY_USER: ${{ secrets.QUAY_USER }}
63-
PR_NUMBER: ${{ github.event.number }}
67+
PR_NUMBER: ${{ inputs.image_tag}}
6468

6569
- name: Comment PR
6670
uses: thollander/actions-comment-pull-request@v2

.github/workflows/pre-release.yml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,22 @@ env:
1616
NIMFLAGS: "--parallelBuild:${NPROC}"
1717

1818
jobs:
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
@@ -57,8 +71,6 @@ jobs:
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
@@ -76,9 +88,23 @@ jobs:
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

Comments
 (0)