Skip to content

Commit

Permalink
Merge pull request #26 from denis-tingajkin/update_to_latest_sdk_manu…
Browse files Browse the repository at this point in the history
…ally

Update to latest sdk manually
  • Loading branch information
haiodo authored Nov 26, 2020
2 parents c3959f0 + ae21b7a commit 2ab2450
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 43 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ jobs:
path: ${{ github.repository }}
repository: ${{ github.repository }}
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- name: Create branch name
working-directory: ${{ github.repository }}
run: |
diff=$(git diff --name-only)
BRANCH_NAME="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
BRANCH_NAME="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${BRANCH_NAME}"
} || {
echo Branch update/"${BRANCH_NAME}" is already deleted
}
fi;
echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV
- name: Create commit message
working-directory: ${{ github.repository }}
run: |
Expand All @@ -239,7 +256,7 @@ jobs:
path: networkservicemesh/integration-k8s-kind
repository: networkservicemesh/integration-k8s-kind
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- uses: benjlevesque/short-sha@v1.1
- uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 8
Expand All @@ -257,24 +274,11 @@ jobs:
echo Repository already up to date
exit 0;
fi
diff=$(git diff --name-only)
branchName="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
branchName="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${branchName}"
} || {
echo Branch update/"${branchName}" is already deleted
}
fi;
git config --global user.email "[email protected]"
git config --global user.name "NSMBot"
git commit -s -F /tmp/commit-message
git checkout -b update/"${branchName}"
while [ $(git push origin update/"${branchName}") ]; do
git fetch origin update/"${branchName}"
git rebase origin/update/"${branchName}"
git checkout -b update/"${BRANCH_NAME}"
while [ $(git push origin update/"${BRANCH_NAME}") ]; do
git fetch origin update/"${BRANCH_NAME}"
git rebase origin/update/"${BRANCH_NAME}"
done
2 changes: 1 addition & 1 deletion .github/workflows/pr-for-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
echo ${PULL_REQUEST_BODY}
echo PULL_REQUEST_BODY=${PULL_REQUEST_BODY} >> $GITHUB_ENV
- name: pull-request-action
uses: vsoch/[email protected].6
uses: vsoch/[email protected].12
env:
GITHUB_TOKEN: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
BRANCH_PREFIX: "update/"
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/update-integration-k8s-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ jobs:
path: ${{ github.repository }}
repository: ${{ github.repository }}
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- name: Create branch name
working-directory: ${{ github.repository }}
run: |
diff=$(git diff --name-only)
BRANCH_NAME="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
BRANCH_NAME="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${BRANCH_NAME}"
} || {
echo Branch update/"${BRANCH_NAME}" is already deleted
}
fi;
echo BRANCH_NAME=${BRANCH_NAME} >> $GITHUB_ENV
- name: Create commit message
working-directory: ${{ github.repository }}
run: |
Expand All @@ -34,7 +51,7 @@ jobs:
path: networkservicemesh/integration-k8s-kind
repository: networkservicemesh/integration-k8s-kind
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- uses: benjlevesque/short-sha@v1.1
- uses: benjlevesque/short-sha@v1.2
id: short-sha
with:
length: 8
Expand All @@ -52,24 +69,11 @@ jobs:
echo Repository already up to date
exit 0;
fi
diff=$(git diff --name-only)
branchName="${{ github.event.repository.name }}"
if [[ $(grep "go.mod" <<< "${diff}") && $(grep "" -c <<< "${diff}") == 2 ]]; then
sdkPattern="github.com\/networkservicemesh\/sdk "
sdkVersion=$(grep --regexp "${sdkPattern}" go.mod)
branchName="${sdkVersion:${#sdkPattern}}"
else
{
git push origin --delete update/"${branchName}"
} || {
echo Branch update/"${branchName}" is already deleted
}
fi;
git config --global user.email "[email protected]"
git config --global user.name "NSMBot"
git commit -s -F /tmp/commit-message
git checkout -b update/"${branchName}"
while [ $(git push origin update/"${branchName}") ]; do
git fetch origin update/"${branchName}"
git rebase origin/update/"${branchName}"
git checkout -b update/"${BRANCH_NAME}"
while [ $(git push origin update/"${BRANCH_NAME}") ]; do
git fetch origin update/"${BRANCH_NAME}"
git rebase origin/update/"${BRANCH_NAME}"
done
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/edwarnicke/grpcfd v0.0.0-20200920223154-d5b6e1f19bd0
github.com/golang/protobuf v1.4.3
github.com/kelseyhightower/envconfig v1.4.0
github.com/networkservicemesh/api v0.0.0-20201108204718-89d65b3605cf
github.com/networkservicemesh/sdk v0.0.0-20201116135409-a04f342c6d6f
github.com/networkservicemesh/api v0.0.0-20201117093615-ae6039374f31
github.com/networkservicemesh/sdk v0.0.0-20201125060248-f3c3c51c88e2
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.7.0
github.com/spiffe/go-spiffe/v2 v2.0.0-alpha.4.0.20200528145730-dc11d0c74e85
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/nats-io/stan.go v0.6.0/go.mod h1:eIcD5bi3pqbHT/xIIvXMwvzXYElgouBvaVRftaE+eac=
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/networkservicemesh/api v0.0.0-20201108204718-89d65b3605cf h1:+qIW+H1bPwP6EZB7E5yeh8H3Ln78x+8Eo+kY4cmCGaA=
github.com/networkservicemesh/api v0.0.0-20201108204718-89d65b3605cf/go.mod h1:qvxdY1Zt4QTtiG+uH1XmjpegeHjlt5Jj4A8iK55iJPI=
github.com/networkservicemesh/sdk v0.0.0-20201116135409-a04f342c6d6f h1:Uz08LoLS3XH1pdMnBHkBzZ4BmnzXYib2gMMNbXHF5r8=
github.com/networkservicemesh/sdk v0.0.0-20201116135409-a04f342c6d6f/go.mod h1:mVDTKBmkdxe8IiP3Un4qTFOSeBqUoJuCa7LtfEZdlTw=
github.com/networkservicemesh/api v0.0.0-20201117093615-ae6039374f31 h1:z5a+28GCNiopGCS1GY2eoTEUf47fbpsSs4eVC0rsgW0=
github.com/networkservicemesh/api v0.0.0-20201117093615-ae6039374f31/go.mod h1:qvxdY1Zt4QTtiG+uH1XmjpegeHjlt5Jj4A8iK55iJPI=
github.com/networkservicemesh/sdk v0.0.0-20201125060248-f3c3c51c88e2 h1:oboT5FLudDdeJP+noW0zdd9JbNglYcUtep5dXxvRd3w=
github.com/networkservicemesh/sdk v0.0.0-20201125060248-f3c3c51c88e2/go.mod h1:/31b39yg0LIs7ZoyVSNjKIMyolXOdYp7KruZeqtUbhg=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c=
Expand Down

0 comments on commit 2ab2450

Please sign in to comment.