Skip to content

Commit

Permalink
Merge pull request #622 from aeswibon/issue#621
Browse files Browse the repository at this point in the history
chore: updates go and github actions  version
  • Loading branch information
Mohd Uzair authored Jan 15, 2024
2 parents d8314a2 + 1f098a2 commit bc57a5d
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 283 deletions.
96 changes: 48 additions & 48 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,62 @@ on:
branches:
- "master"
paths-ignore:
- '.github/**'
- ".github/**"

jobs:
build:
name: Build check
runs-on: ubuntu-22.04
# needs: [lint, error_check, static_check, vet, sec_check, tests]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build .
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build .
docker:
name: Docker build and push
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Docker login
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker edge build & tag
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest --build-arg TOKEN=${{ secrets.GLOBAL_TOKEN }} --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION="edge-latest" .
docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
- name: Docker edge push
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
docker push ${{ secrets.IMAGE_NAME }}:edge-latest
docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
- name: Docker stable build & tag
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION=${GITHUB_REF/refs\/tags\//} .
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
- name: Docker stable push
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
docker push ${{ secrets.IMAGE_NAME }}:stable-latest
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
- name: Docker Hub Description
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
uses: peter-evans/dockerhub-description@v2.4.3
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }}
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Docker login
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker edge build & tag
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest --build-arg TOKEN=${{ secrets.GLOBAL_TOKEN }} --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION="edge-latest" .
docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
- name: Docker edge push
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
docker push ${{ secrets.IMAGE_NAME }}:edge-latest
docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7}
- name: Docker stable build & tag
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION=${GITHUB_REF/refs\/tags\//} .
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
- name: Docker stable push
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
docker push ${{ secrets.IMAGE_NAME }}:stable-latest
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//}
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7}
- name: Docker Hub Description
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ secrets.IMAGE_NAME }}
55 changes: 27 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
tags:
- "v*"
paths-ignore:
- 'docs/**'
- '.github/**'
- "docs/**"
- ".github/**"
pull_request:
branches:
- master
Expand All @@ -18,8 +18,8 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/checkout@v3
go-version: 1.21
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -28,27 +28,26 @@ jobs:
args: --timeout=5m
tests:
# needs: [lint, error_check, static_check, vet, sec_check]
name: Tests
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Create cluster using KinD
uses: engineerd/[email protected]
with:
version: "v0.11.0"
- run: |
export CURRENTCONTEXT="$(kubectl config current-context)"
echo "current-context:" ${CURRENTCONTEXT}
export KUBECONFIG="${HOME}/.kube/config"
echo "environment-kubeconfig:" ${KUBECONFIG}
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go test -v ./...
name: Tests
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Create cluster using KinD
uses: engineerd/[email protected]
with:
version: "v0.11.1"
- run: |
export CURRENTCONTEXT="$(kubectl config current-context)"
echo "current-context:" ${CURRENTCONTEXT}
export KUBECONFIG="${HOME}/.kube/config"
echo "environment-kubeconfig:" ${KUBECONFIG}
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go test -v ./...
14 changes: 7 additions & 7 deletions .github/workflows/component-generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ name: Meshery Istio Pattern Components Generator
on:
push:
branches:
- 'master'
- "master"
paths-ignore:
- 'docs/**'
- '.github/**'
- "docs/**"
- ".github/**"
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * *"
jobs:
GenerateComponents:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
token: ${{ secrets.GH_ACCESS_TOKEN }}
ref: "master"
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21
- name: Run adapter to create components
run: |
touch log.txt
Expand Down
84 changes: 42 additions & 42 deletions .github/workflows/components-to-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,54 @@ jobs:
CopyComponents:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Make components to .md files
run: |
function join_by {
local d=${1-} f=${2-}
if shift 2; then
echo "$f${@/#/$d}"
fi
}
mkdir output
folder_path=templates/meshmodel/components/*
for file in $folder_path;
do
folder_name="$file/*"
onlyfolder=$(basename "$file")
echo "---
component: $onlyfolder
integrations:" > $onlyfolder.md
for indFile in $folder_name;
do
filename=$(basename "$indFile")
temp_filename=$filename
IFS="."
read -ra newarr <<< "$temp_filename"
IFS=""
if [[ "${newarr[7]}" == "schema" ]]
then
continue
fi
ans=$(join_by . ${newarr[0]} ${newarr[1]})
echo " - $ans" >> $onlyfolder.md
done
echo "---" >> $onlyfolder.md
mv $onlyfolder.md output
done
function join_by {
local d=${1-} f=${2-}
if shift 2; then
echo "$f${@/#/$d}"
fi
}
mkdir output
folder_path=templates/meshmodel/components/*
for file in $folder_path;
do
folder_name="$file/*"
onlyfolder=$(basename "$file")
echo "---
component: $onlyfolder
integrations:" > $onlyfolder.md
for indFile in $folder_name;
do
filename=$(basename "$indFile")
temp_filename=$filename
IFS="."
read -ra newarr <<< "$temp_filename"
IFS=""
if [[ "${newarr[7]}" == "schema" ]]
then
continue
fi
ans=$(join_by . ${newarr[0]} ${newarr[1]})
echo " - $ans" >> $onlyfolder.md
done
echo "---" >> $onlyfolder.md
mv $onlyfolder.md output
done
- name: Pushes folder to main repo
uses: crykn/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.GH_ACCESS_TOKEN }}
with:
source_folder: 'output'
destination_repo: 'meshery/meshery'
destination_folder: 'docs/_integrations/istio'
destination_branch: 'master'
user_email: '[email protected]'
user_name: 'l5io'
commit_msg: 'Adapters Component added'
source_folder: "output"
destination_repo: "meshery/meshery"
destination_folder: "docs/_integrations/istio"
destination_branch: "master"
user_email: "[email protected]"
user_name: "l5io"
commit_msg: "Adapters Component added"
Loading

0 comments on commit bc57a5d

Please sign in to comment.