diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bb4d4c12..2467d51a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -127,9 +127,16 @@ jobs: if: steps.docker_login.outcome == 'success' run: | docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/${{github.repository}}/vpp:${TAG} . --target vpp --push - docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/${{github.repository}}/vpp-dbg:${TAG} . --target vpp-dbg --push echo docker_tag=${TAG} >> $GITHUB_OUTPUT + - name: Push tag ${TAG} + id: tag_commit + if: steps.docker_push.outcome == 'success' + run: | + git status + git tag ${TAG} ${{github.sha}} + git push origin ${TAG} -f + delete_github_runner: name: Delete actions runner if: ${{ always() }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..72f9cd62 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +--- +name: Release + +on: + workflow_run: + types: + - completed + workflows: + - "ci" +jobs: + get-tag: + name: Get tag + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_branch, 'release/') }} + outputs: + tag: ${{ steps.get-tag-step.outputs.tag }} + steps: + - name: Get tag + run: | + branch=${{github.event.workflow_run.head_branch}} + echo tag=${branch#release/} >> $GITHUB_OUTPUT + id: get-tag-step + + check-gomod-deps: + needs: get-tag + uses: networkservicemesh/.github/.github/workflows/check-gomod-deps.yaml@main + with: + tag: ${{ needs.get-tag.outputs.tag }} + + create-release: + needs: [get-tag, check-gomod-deps] + uses: networkservicemesh/.github/.github/workflows/release.yaml@main + secrets: + token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} + + docker: + needs: [get-tag, check-gomod-deps] + uses: networkservicemesh/.github/.github/workflows/docker-release.yaml@main + with: + tag: ${{ needs.get-tag.outputs.tag }} + secrets: + token: ${{ secrets.GITHUB_TOKEN }} + + check-branch: + name: Check release branch in deployments-k8s + needs: [get-tag, create-release] + uses: networkservicemesh/.github/.github/workflows/check-release-branch.yaml@main + with: + tag: ${{ needs.get-tag.outputs.tag }} + secrets: + token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} + + update-deployments-k8s: + name: Update deployments-k8s + needs: [get-tag, check-branch] + if: ${{ github.repository != 'networkservicemesh/cmd-template' }} + uses: networkservicemesh/.github/.github/workflows/release-deployments.yaml@main + with: + tag: ${{ needs.get-tag.outputs.tag }} + secrets: + token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }} diff --git a/README.md b/README.md index 125ff01d..8f50739c 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,24 @@ This repo provides the go binding for a version of vpp. ```go -import "github.com/edwarnicke/govpp/binapi" +import "github.com/networkservicemesh/govpp/binapi" ``` -This repo also provides minimal docker containers for running vpp: +This repo also provides minimal docker container for running vpp: -- [vpp](https://github.com/users/edwarnicke/packages/container/package/govpp%2Fvpp) -- [vpp-dbg](https://github.com/users/edwarnicke/packages/container/package/govpp%2Fvpp) - debug image +- [vpp](https://github.com/networkservicemesh/govpp/pkgs/container/govpp%2Fvpp) ## How to match the version of vpp you want to the go bindings. -Whenever a combination of [VPP_VERSION](https://github.com/edwarnicke/govpp/blob/e0e3b4843cf510bccc6e6a6eac43729a5e5fa42f/Dockerfile#L1) -and [cherrypicks/patches](https://github.com/edwarnicke/govpp/blob/e0e3b4843cf510bccc6e6a6eac43729a5e5fa42f/patch/patch.sh) is used to build vpp/vpp-dbg docker containers, +Whenever a combination of [VPP_VERSION](https://github.com/networkservicemesh/govpp/blob/main/Dockerfile#L1) +and [cherrypicks/patches](https://github.com/networkservicemesh/govpp/blob/main/patch/patch.sh) is used to build vpp docker container, they will be tagged in the docker repo. The corresponding tag will be laid on the main branch containing the corresponding binapi. So simply run in the same directory as your go.mod file: ```bash -go get github.com/edwarnicke/govpp/binapi@${tag} +go get github.com/networkservicemesh/govpp/binapi@${tag} ``` Where `${tag}` is the tag of the vpp container you are consuming. @@ -29,7 +28,7 @@ Where `${tag}` is the tag of the vpp container you are consuming. For example: ```bash -go get github.com/edwarnicke/govpp/binapi@v21.06.0-9-16f166164 +go get github.com/networkservicemesh/govpp/binapi@v21.06.0-9-16f166164 ``` To set your go dependency for govpp to match the docker container you are using. @@ -39,9 +38,9 @@ To set your go dependency for govpp to match the docker container you are using. If you want a version of VPP, you can fork *this* repo and add it yourself. Because things are very heavily patterned and generated, its really quite easy: -1. Change default value for ARG VPP_VERSION in [Dockerfile](https://github.com/edwarnicke/govpp/blob/main/Dockerfile#L1) to the vpp tag or commit id you want to build. +1. Change default value for ARG VPP_VERSION in [Dockerfile](https://github.com/networkservicemesh/govpp/blob/main/Dockerfile#L1) to the vpp tag or commit id you want to build. 2. ```go generate ./...``` -3. Push a PR to your fork and merge it. This will push the vpp and vpp-dbg images to your repo. +3. Push a PR to your fork and merge it. This will push the vpp image to your repo. ## What to do if you need to cherrypick into VPP @@ -49,11 +48,11 @@ See [patch/patch.sh]. Simply add your cherrypicks to that file. ## What to do if you need to patch vpp: -If you want to add patches to vpp simply add them with the `.patch` suffix to the [patch/](https://github.com/edwarnicke/govpp/blob/main/patch/) directory. +If you want to add patches to vpp simply add them with the `.patch` suffix to the [patch/](https://github.com/networkservicemesh/govpp/blob/main/patch/) directory. ## What to do if you need a different version of govpp -Change the version of [govpp in the go.mod file](https://github.com/edwarnicke/govpp/blob/main/go.mod#L5) +Change the version of [govpp in the go.mod file](https://github.com/networkservicemesh/govpp/blob/main/go.mod#L5) ## How the magic works ##