mirror of https://github.com/waku-org/nwaku.git
chore(ci): extend and rename nightly workflow to support RC builds (#1784)
This commit is contained in:
parent
dba84248f1
commit
960740713c
|
@ -1,6 +1,9 @@
|
||||||
name: Nightly Release
|
name: Pre-Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*-rc.*'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 13 3 * * *
|
- cron: 13 3 * * *
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
@ -28,41 +31,41 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
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
|
|
||||||
key: ${{ runner.os }}-${{matrix.arch}}-submodules-${{ steps.submodules.outputs.hash }}
|
|
||||||
|
|
||||||
|
|
||||||
- name: prep variables
|
- name: prep variables
|
||||||
id: vars
|
id: vars
|
||||||
run: |
|
run: |
|
||||||
|
ARCH=${{matrix.arch}}
|
||||||
EXPERIMENTAL=$([[ "${{ matrix.experimental }}" == "true" ]] && echo "-experimental" || echo "")
|
EXPERIMENTAL=$([[ "${{ matrix.experimental }}" == "true" ]] && echo "-experimental" || echo "")
|
||||||
|
TAG=$([[ "${{github.ref}}" == "refs/heads/master" ]] && echo "${{env.RELEASE_NAME}}" || echo ${{github.ref}} | sed 's#refs/tags/##')
|
||||||
|
|
||||||
|
echo "arch=${ARCH}" >> $GITHUB_OUTPUT
|
||||||
echo "experimental=${EXPERIMENTAL}" >> $GITHUB_OUTPUT
|
echo "experimental=${EXPERIMENTAL}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
NWAKU_ARTIFACT_NAME=$(echo "nwaku${EXPERIMENTAL}-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
NWAKU_ARTIFACT_NAME=$(echo "nwaku${EXPERIMENTAL}-${ARCH}-${{runner.os}}-${TAG}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
||||||
NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools${EXPERIMENTAL}-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools${EXPERIMENTAL}-${ARCH}-${{runner.os}}-${TAG}.tar.gz" | tr "[:upper:]" "[:lower:]")
|
||||||
|
|
||||||
echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||||
echo "nwakutools=${NWAKU_TOOLS_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
echo "nwakutools=${NWAKU_TOOLS_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
- name: build artifacts
|
- name: build artifacts
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
|
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
|
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false EXPERIMENTAL=${{matrix.experimental}} NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
|
||||||
|
update
|
||||||
|
|
||||||
tar -cvzf ${{steps.vars.outputs.nwaku}} ./build/wakunode2
|
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false EXPERIMENTAL=${{matrix.experimental}} NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
|
||||||
|
wakunode2\
|
||||||
|
chat2\
|
||||||
|
tools
|
||||||
|
|
||||||
|
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
|
||||||
|
wakunode1
|
||||||
|
|
||||||
|
|
||||||
|
tar -cvzf ${{steps.vars.outputs.nwaku}} ./build/wakunode1 ./build/wakunode2 ./build/chat2
|
||||||
tar -cvzf ${{steps.vars.outputs.nwakutools}} ./build/wakucanary ./build/networkmonitor
|
tar -cvzf ${{steps.vars.outputs.nwakutools}} ./build/wakucanary ./build/networkmonitor
|
||||||
|
|
||||||
- name: upload artifacts
|
- name: upload artifacts
|
||||||
|
@ -88,15 +91,29 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
- name: download artifacts
|
- name: download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
|
|
||||||
|
- name: prep variables
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
RELEASE=$([[ "${{github.ref}}" == "refs/heads/master" ]] && echo "${{env.RELEASE_NAME}}" || echo ${{github.ref}} | sed 's#refs/tags/##')
|
||||||
|
REF=$(echo ${{github.ref}} | sed 's#.*/##')
|
||||||
|
|
||||||
|
echo "release=${RELEASE}" >> $GITHUB_OUTPUT
|
||||||
|
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: generate release notes
|
- name: generate release notes
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
gh release view ${RELEASE_NAME} &>/dev/null &&\
|
set -x
|
||||||
gh release delete -y ${RELEASE_NAME} --cleanup-tag &&\
|
gh release view ${{steps.vars.outputs.release}} &>/dev/null &&\
|
||||||
git tag -d ${RELEASE_NAME}
|
gh release delete -y ${{steps.vars.outputs.release}} &&\
|
||||||
|
[[ "${{steps.vars.outputs.release}}" == "nightly" ]] && git tag -d ${{steps.vars.outputs.release}}
|
||||||
|
|
||||||
|
RELEASE_NOTES_TAG=$([[ "${{steps.vars.outputs.release}}" != "nightly" ]] && echo "-t ${{steps.vars.outputs.ref}}" || echo "")
|
||||||
|
|
||||||
docker run \
|
docker run \
|
||||||
-t \
|
-t \
|
||||||
|
@ -104,13 +121,15 @@ jobs:
|
||||||
-v ${PWD}:/opt/sv4git/repo:z \
|
-v ${PWD}:/opt/sv4git/repo:z \
|
||||||
-u $(id -u) \
|
-u $(id -u) \
|
||||||
docker.io/wakuorg/sv4git:latest \
|
docker.io/wakuorg/sv4git:latest \
|
||||||
release-notes |\
|
release-notes ${RELEASE_NOTES_TAG} --previous $(git tag -l --sort -creatordate | grep -e "^v[0-9]*\.[0-9]*\.[0-9]*$") |\
|
||||||
sed -E 's@#([0-9]+)@[#\1](https://github.com/waku-org/nwaku/issues/\1)@g' > release_notes.md
|
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
|
sed -i "s/^## .*/Generated at $(date)/" release_notes.md
|
||||||
|
|
||||||
cat release_notes.md
|
cat release_notes.md
|
||||||
|
|
||||||
gh release create ${RELEASE_NAME} --prerelease --target master \
|
TARGET=$([[ "${{steps.vars.outputs.release}}" == "nightly" ]] && echo "--target ${{steps.vars.outputs.ref}}" || echo "")
|
||||||
--title ${RELEASE_NAME} --notes-file release_notes.md \
|
|
||||||
|
gh release create ${{steps.vars.outputs.release}} --prerelease ${TARGET} \
|
||||||
|
--title ${{steps.vars.outputs.release}} --notes-file release_notes.md \
|
||||||
wakunode2/* tools/*
|
wakunode2/* tools/*
|
|
@ -2,6 +2,7 @@ version: "1.1" #config version
|
||||||
|
|
||||||
tag:
|
tag:
|
||||||
pattern: "v%d.%d.%d"
|
pattern: "v%d.%d.%d"
|
||||||
|
filter: "v*"
|
||||||
|
|
||||||
release-notes:
|
release-notes:
|
||||||
sections: # Array with each section of release note. Check template section for more information.
|
sections: # Array with each section of release note. Check template section for more information.
|
||||||
|
|
|
@ -22,39 +22,51 @@ Ensure all items in this list are ticked:
|
||||||
|
|
||||||
1. Checkout a release branch from master
|
1. Checkout a release branch from master
|
||||||
|
|
||||||
`git checkout -b release/v0.1`
|
```
|
||||||
|
git checkout -b release/v0.1.0
|
||||||
|
```
|
||||||
|
|
||||||
2. Update `CHANGELOG.md` and ensure it is up to date
|
1. Update `CHANGELOG.md` and ensure it is up to date. Use the helper Make target to get PR based release-notes/changelog update.
|
||||||
|
|
||||||
3. Create a tag with the same name as release and push it
|
```
|
||||||
|
make release-notes
|
||||||
|
```
|
||||||
|
|
||||||
```
|
1. Create a release-candidate tag with the same name as release and `-rc.N` suffix a few days before the official release and push it
|
||||||
git tag -as v0.1 -m "Initial release."
|
|
||||||
git push origin v0.1
|
|
||||||
```
|
|
||||||
|
|
||||||
4. Open a PR
|
```
|
||||||
|
git tag -as v0.1.0-rc.0 -m "Initial release."
|
||||||
|
git push origin v0.1.0-rc.0
|
||||||
|
```
|
||||||
|
|
||||||
5. Harden release in release branch
|
This will trigger a [workflow](../../.github/workflows/pre-release.yml) which will build RC artifacts and create and publish a Github release
|
||||||
- Create a [Github release](https://github.com/waku-org/nwaku/releases) on the release tag.
|
|
||||||
- Add binaries for `macos` and `ubuntu` as release assets. Binaries can be compiled by triggering the ["Upload Release Asset"](https://github.com/waku-org/nwaku/actions/workflows/release-assets.yml) workflow. Where possible, test the binaries before uploading to the release.
|
|
||||||
|
|
||||||
6. Modify tag
|
1. Open a PR from the release branch for others to review the included changes and the release-notes
|
||||||
|
|
||||||
If you need to update stuff, remove tag and make sure the new tag is associated
|
1. In case additional changes are needed, create a new RC tag
|
||||||
with CHANGELOG update.
|
|
||||||
|
|
||||||
```
|
Make sure the new tag is associated
|
||||||
# Delete tag
|
with CHANGELOG update.
|
||||||
git tag -d v0.1
|
|
||||||
git push --delete origin v0.1
|
|
||||||
|
|
||||||
# Make changes, rebase and tag again
|
```
|
||||||
# Squash to one commit and make a nice commit message
|
# Make changes, rebase and create new tag
|
||||||
git rebase -i origin/master
|
# Squash to one commit and make a nice commit message
|
||||||
git tag -as v0.1 -m "Initial release."
|
git rebase -i origin/master
|
||||||
git push origin v0.1
|
git tag -as v0.1.0-rc.1 -m "Initial release."
|
||||||
```
|
git push origin v0.1.0-rc.1
|
||||||
|
```
|
||||||
|
|
||||||
|
1. Once the release-candidate has been validated, create a final release tag and push it.
|
||||||
|
|
||||||
|
```
|
||||||
|
git checkout release/v0.1.0
|
||||||
|
git tag -as v0.1.0 -m "Initial release."
|
||||||
|
git push origin v0.1.0
|
||||||
|
```
|
||||||
|
|
||||||
|
1. Create a [Github release](https://github.com/waku-org/nwaku/releases) from the release tag.
|
||||||
|
|
||||||
|
* Add binaries produced by the ["Upload Release Asset"](https://github.com/waku-org/nwaku/actions/workflows/release-assets.yml) workflow. Where possible, test the binaries before uploading to the release.
|
||||||
|
|
||||||
### After the release
|
### After the release
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue