From 876609d8cba7b173ea69972ab4339a8266d3e163 Mon Sep 17 00:00:00 2001 From: NSMBot Date: Wed, 8 Jan 2025 11:25:28 +0000 Subject: [PATCH] Update go.mod and go.sum to networkservicemesh/sdk-vpp@v1.14.2-rc.4 Signed-off-by: NSMBot --- .github/workflows/release.yml | 35 ++++++++- .../scripts/generate-release-notes.js | 72 +++++++++++++++++++ go.mod | 12 ++-- go.sum | 24 +++---- 4 files changed, 122 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/scripts/generate-release-notes.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8fcf39e9..657c15fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,10 +31,39 @@ jobs: create-release: needs: [get-tag, check-gomod-deps] - uses: networkservicemesh/.github/.github/workflows/release.yaml@main - secrets: - token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} + runs-on: ubuntu-latest + steps: + - name: Choose branch + id: branch + run: | + branch=${{ github.event.workflow_run.head_branch }} + if [ -z "$branch" ]; then + ref=${{ github.event.ref }} + branch=${ref#refs/heads/} + fi + echo "$branch" + echo branch=${branch} >> $GITHUB_OUTPUT + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: refs/heads/${{ steps.branch.outputs.branch }} + + - name: Push tag ${{ needs.get-tag.outputs.tag }} + run: | + git status + git tag ${{ needs.get-tag.outputs.tag }} + git push origin ${{ needs.get-tag.outputs.tag }} -f + + - name: Generate Release Notes + id: generate-release-notes + run: node .github/workflows/scripts/generate-release-notes.js '${{ secrets.NSM_BOT_GITHUB_TOKEN }}' '${{ needs.get-tag.outputs.tag }}' > notes.tx + + - name: Create release ${{ needs.get-tag.outputs.tag }} + run: | + gh release create ${{ needs.get-tag.outputs.tag }} --title ${{ needs.get-tag.outputs.tag }} --target ${{github.event.workflow_run.head_branch}} --notes-file notes.txt + env: + GH_TOKEN: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} docker: needs: [get-tag, check-gomod-deps] uses: networkservicemesh/.github/.github/workflows/docker-release.yaml@main diff --git a/.github/workflows/scripts/generate-release-notes.js b/.github/workflows/scripts/generate-release-notes.js new file mode 100644 index 00000000..261ec884 --- /dev/null +++ b/.github/workflows/scripts/generate-release-notes.js @@ -0,0 +1,72 @@ +// ./tools/scripts/generate-release-notes.js + +const github = require('@actions/github'); + +/** + * Generates the release notes for a github release. + * + * Arguments: + * 1 - github_token + * 2 - new version + */ +const token = process.argv[2]; +const version = process.argv[3]; + +async function main() { + const client = github.getOctokit(token); + + const latestReleaseResponse = await client.request( + 'GET /repos/{owner}/{repo}/releases/latest', + { + owner: 'networkservicemesh', + repo: 'cmd-forwarder-vpp', + headers: { + 'X-GitHub-Api-Version': '2022-11-28', + }, + } + ); + const previousTag = latestReleaseResponse.data?.tag_name; + + const response = await client.request( + 'POST /repos/{owner}/{repo}/releases/generate-notes', + { + owner: 'networkservicemesh', + repo: 'cmd-forwarder-vpp', + tag_name: version, + previous_tag_name: previousTag, + headers: { + 'X-GitHub-Api-Version': '2022-11-28', + }, + } + ); + + const noteSections = response.data.body?.split('\n\n'); + const trimmedSections = []; + const githubNotesMaxCharLength = 125000; + const maxSectionLength = githubNotesMaxCharLength / noteSections.length; + for (let i = 0; i < noteSections.length; i++) { + if (noteSections[i].length > githubNotesMaxCharLength) { + const lastLineIndex = + noteSections[i].substring(0, maxSectionLength).split('\n').length - 1; + const trimmed = + noteSections[i] + .split('\n') + .slice(0, lastLineIndex - 1) + .join('\n') + + `\n... (+${ + noteSections[i].split('\n').length - (lastLineIndex + 1) + } others)`; + trimmedSections.push(trimmed); + continue; + } + + trimmedSections.push(noteSections[i]); + } + + console.log(trimmedSections.join('\n\n')); +} + +main().catch((e) => { + console.error(`Failed generating release notes with error: ${e}`); + process.exit(0); +}); \ No newline at end of file diff --git a/go.mod b/go.mod index c8dc19d4..157c4d13 100644 --- a/go.mod +++ b/go.mod @@ -12,13 +12,13 @@ require ( github.com/golang/protobuf v1.5.3 github.com/google/uuid v1.3.1 github.com/kelseyhightower/envconfig v1.4.0 - github.com/networkservicemesh/api v1.14.2-rc.1.0.20241209080353-bbb4cd5f8f00 + github.com/networkservicemesh/api v1.14.2-rc.4 github.com/networkservicemesh/govpp v0.0.0-20240328101142-8a444680fbba - github.com/networkservicemesh/sdk v0.5.1-0.20241227223757-422abe9bfbdd - github.com/networkservicemesh/sdk-k8s v0.0.0-20241227224209-e9478b00a551 - github.com/networkservicemesh/sdk-kernel v0.0.0-20241227224026-3bba51753247 - github.com/networkservicemesh/sdk-sriov v0.0.0-20241227143415-9231b416bfd2 - github.com/networkservicemesh/sdk-vpp v0.0.0-20241227224413-166396795a3c + github.com/networkservicemesh/sdk v1.14.2-rc.4 + github.com/networkservicemesh/sdk-k8s v1.14.2-rc.4 + github.com/networkservicemesh/sdk-kernel v1.14.2-rc.4 + github.com/networkservicemesh/sdk-sriov v1.14.2-rc.4 + github.com/networkservicemesh/sdk-vpp v1.14.2-rc.4 github.com/networkservicemesh/vpphelper v0.0.0-20241209033247-bcb5c25a9f29 github.com/pkg/errors v0.9.1 github.com/safchain/ethtool v0.3.0 diff --git a/go.sum b/go.sum index 05b150c5..0d5f2329 100644 --- a/go.sum +++ b/go.sum @@ -152,20 +152,20 @@ github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcK github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= -github.com/networkservicemesh/api v1.14.2-rc.1.0.20241209080353-bbb4cd5f8f00 h1:xZGg3H5j9UoQW7GasoQrBtH4RkB9bgKdfuRIM9EUkCQ= -github.com/networkservicemesh/api v1.14.2-rc.1.0.20241209080353-bbb4cd5f8f00/go.mod h1:GT0Yw1LYFSTxlDyJjBDhIxT82rJ2czZ0TiyzxSyKzvg= +github.com/networkservicemesh/api v1.14.2-rc.4 h1:ksjhPpwJsegbxSbw2zDbG/c0DUBGPJ7gQkMhkCNuvYg= +github.com/networkservicemesh/api v1.14.2-rc.4/go.mod h1:GT0Yw1LYFSTxlDyJjBDhIxT82rJ2czZ0TiyzxSyKzvg= github.com/networkservicemesh/govpp v0.0.0-20240328101142-8a444680fbba h1:7B6X6N7rwJNpnfsUlBavxuZdYqTx8nAKwxVS/AkuX1o= github.com/networkservicemesh/govpp v0.0.0-20240328101142-8a444680fbba/go.mod h1:CwikXQ3p/y3j6+HbQQWXKv0f4LPyUd2vKTiViG93qWA= -github.com/networkservicemesh/sdk v0.5.1-0.20241227223757-422abe9bfbdd h1:p7yvEC3kZInerbyyRTjLC51uw40Kxbb3rMw+2JsoiU0= -github.com/networkservicemesh/sdk v0.5.1-0.20241227223757-422abe9bfbdd/go.mod h1:4UxNmG1wYL5v93pZHIgIn0jTsvzn4x0QioQ/v48zuD8= -github.com/networkservicemesh/sdk-k8s v0.0.0-20241227224209-e9478b00a551 h1:NU51ozpI8c4n9ggRo6YbuIrWM6Wl1tvZU806SLXT1pQ= -github.com/networkservicemesh/sdk-k8s v0.0.0-20241227224209-e9478b00a551/go.mod h1:xa/qsmtikpFATqfJoePQocbnEspXyNVdMqZfUn4oo4I= -github.com/networkservicemesh/sdk-kernel v0.0.0-20241227224026-3bba51753247 h1:Zx8945OqaGsQYRncEFf/j/qb4jMJ+0U4xMZvb4cmt8Y= -github.com/networkservicemesh/sdk-kernel v0.0.0-20241227224026-3bba51753247/go.mod h1:BEcSP25b0qmilHCYv5QtGtADOI4sU8eX/lJskK5O5fc= -github.com/networkservicemesh/sdk-sriov v0.0.0-20241227143415-9231b416bfd2 h1:DbkuALmWeZCn9JOeXq8idyoSyxGnJTascFUbiUgd9LQ= -github.com/networkservicemesh/sdk-sriov v0.0.0-20241227143415-9231b416bfd2/go.mod h1:gqRPwBXANrBt1PPuyBrn1nZKhrj5CCfqNdMMu/aN9ZA= -github.com/networkservicemesh/sdk-vpp v0.0.0-20241227224413-166396795a3c h1:sLos0zvQuAqbTjvIM0ZIJ+w0XE/RCDgrWfEz5N8zmPA= -github.com/networkservicemesh/sdk-vpp v0.0.0-20241227224413-166396795a3c/go.mod h1:UeWHbi3ozPYRxoA2nlZNWsSDnsMCr4PM5abgtJO93iM= +github.com/networkservicemesh/sdk v1.14.2-rc.4 h1:7yMmHGfVBLgT/uGzwkPswvcbEkE4owrknYGGbsulCoY= +github.com/networkservicemesh/sdk v1.14.2-rc.4/go.mod h1:f/e539+bNnnGK5YZa/7Hh5xfcJuQ/iseIfb2tgCxcag= +github.com/networkservicemesh/sdk-k8s v1.14.2-rc.4 h1:RNPpugyZX43Zj9X5+0M63CGMtSATrQQEYD8tG6Kon9I= +github.com/networkservicemesh/sdk-k8s v1.14.2-rc.4/go.mod h1:wRaMyMT9eiy9061bHk8yElOrXpgyXPi/zh2lpE/JE0c= +github.com/networkservicemesh/sdk-kernel v1.14.2-rc.4 h1:aN5wv7cx0ehfhYvfXWloTrpjRxQU0UXD7gnhr3Zz2m8= +github.com/networkservicemesh/sdk-kernel v1.14.2-rc.4/go.mod h1:9xEIBxnLOh943Wf4qpnCWvRMHHEzQ/SFTOD4c6NJfa4= +github.com/networkservicemesh/sdk-sriov v1.14.2-rc.4 h1:iCIVrmiJtbdK6eRnaxZkU/BL538msPb4sHlToswnXZ4= +github.com/networkservicemesh/sdk-sriov v1.14.2-rc.4/go.mod h1:3bc53752lo2O13VtUHaBtCXIgkq54XN1UBor70g+mkQ= +github.com/networkservicemesh/sdk-vpp v1.14.2-rc.4 h1:usrjWFz5tezyImT/F/1dppRnPXjsB6vGBFXKfhZNR/Q= +github.com/networkservicemesh/sdk-vpp v1.14.2-rc.4/go.mod h1:H6OyJsWRDvO+W+PG1Ed4qX/yJ79SZUEEN4+FzEoYZA8= github.com/networkservicemesh/vpphelper v0.0.0-20241209033247-bcb5c25a9f29 h1:hqYoTeQ9mFOIoKUMBXg779SU2yJWrrapucKgoPNZ1co= github.com/networkservicemesh/vpphelper v0.0.0-20241209033247-bcb5c25a9f29/go.mod h1:Qc5x5poZk5cVzcHk4ZIL6+NMC95uoitsmmnl7X9V/Yw= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=