forked from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sudhanshutech/sudhanshutech-patch-1
Update build-and-release-stable.yml
- Loading branch information
Showing
2 changed files
with
0 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,222 +5,7 @@ on: | |
- "v*" | ||
|
||
jobs: | ||
|
||
update-rest-api-docs: | ||
name: Update REST API Documentation | ||
if: github.repository == 'meshery/meshery' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check if handlers were modified | ||
uses: dorny/paths-filter@v3 | ||
id: changes | ||
with: | ||
filters: | | ||
modified: | ||
- added|modified: "server/handlers/**" | ||
- name: Setup go-swagger | ||
if: steps.changes.outputs.modified == 'true' | ||
uses: minchao/setup-go-swagger@v1 | ||
with: | ||
version: v0.30.5 | ||
- name: swagger-spec | ||
if: steps.changes.outputs.modified == 'true' | ||
run: | | ||
make swagger-build | ||
- name: swagger-docs | ||
if: steps.changes.outputs.modified == 'true' | ||
run: | | ||
make swagger-docs-build | ||
- name: Pull changes from remote | ||
run: git pull origin master | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
file_pattern: docs | ||
commit_user_name: l5io | ||
commit_user_email: [email protected] | ||
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
commit_options: "--signoff" | ||
commit_message: "[Docs] Updated Swagger Docs for REST API" | ||
|
||
update-graphql-docs: | ||
name: Update GraphQL API Documentation | ||
if: github.repository == 'meshery/meshery' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Check if schema was modified | ||
uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
modified: | ||
- added|modified: 'server/internal/graphql/schema/schema.graphql' | ||
- name: Set up Ruby | ||
if: steps.filter.outputs.modified == 'true' | ||
uses: ruby/[email protected] | ||
with: | ||
ruby-version: 3.2.2 | ||
bundler-cache: true | ||
- name: graphql-docs | ||
if: steps.filter.outputs.modified == 'true' | ||
run: | | ||
cd docs; bundle install; cd ..; \ | ||
make graphql-docs-build | ||
- name: Pull changes from remote | ||
run: git pull origin master | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
file_pattern: docs | ||
commit_user_name: l5io | ||
commit_user_email: [email protected] | ||
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
commit_options: "--signoff" | ||
commit_message: "[Docs] Updated GraphQL API Documentation" | ||
|
||
build: | ||
name: Docker build and push | ||
if: github.repository == 'meshery/meshery' | ||
env: | ||
RELEASE_CHANNEL: "stable" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker stable and playground build & tag | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build -f install/docker/Dockerfile --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg TOKEN=${{ secrets.GLOBAL_TOKEN }} --build-arg GIT_COMMITSHA=${GITHUB_SHA::8} --build-arg GIT_VERSION=${GITHUB_REF/refs\/tags\//} --build-arg RELEASE_CHANNEL=${RELEASE_CHANNEL} --build-arg PLAYGROUND=true . | ||
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::8} | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:playground-latest | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:playground-${GITHUB_REF/refs\/tags\//} | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:playground-${GITHUB_SHA::8} | ||
- name: Docker stable and playground push | ||
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::8} | ||
docker push ${{ secrets.IMAGE_NAME }}:playground-latest | ||
docker push ${{ secrets.IMAGE_NAME }}:playground-${GITHUB_REF/refs\/tags\//} | ||
docker push ${{ secrets.IMAGE_NAME }}:playground-${GITHUB_SHA::8} | ||
# SKIP STEP: FAILS BECAUSE README FILE SIZE IS TOO LARGE FOR DOCKER HUB | ||
# - name: Docker Hub Description | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# env: | ||
# DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
# DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
# DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }} | ||
ctlrelease: | ||
name: Mesheryctl build & release | ||
if: github.repository == 'meshery/meshery' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'patch') && !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') | ||
runs-on: macos-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: "1.21" | ||
- name: goreleaser with tag | ||
uses: goreleaser/goreleaser-action@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_NOTES_PAT }} | ||
RELEASE_CHANNEL: "stable" | ||
with: | ||
version: latest | ||
args: release --clean --skip=validate | ||
- name: bump homebrew-core formula | ||
uses: mislav/bump-homebrew-formula-action@v3 | ||
with: | ||
formula-name: mesheryctl | ||
download-url: https://github.com/meshery/meshery.git | ||
env: | ||
COMMITTER_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
call-dde-release-workflow: | ||
needs: | ||
- build | ||
- ctlrelease | ||
name: Build and Release Docker Extension | ||
uses: meshery/meshery/.github/workflows/build-and-release-dde.yml@master | ||
secrets: inherit | ||
call-helm-chart-releaser: | ||
needs: | ||
- build | ||
name: Release Helm Charts | ||
uses: meshery/meshery/.github/workflows/helm-chart-releaser.yml@master | ||
secrets: inherit | ||
# call-aks-playground-deploy-workflow: | ||
# needs: build | ||
# name: Deploy Meshery Playground | ||
# uses: meshery/meshery/.github/workflows/deploy-meshery-playground.yml@master | ||
# secrets: inherit | ||
email-meshery-release-notes-workflow: | ||
needs: | ||
- build | ||
- ctlrelease | ||
- call-helm-chart-releaser | ||
- call-dde-release-workflow | ||
name: Email Meshery Release Notes | ||
uses: layer5labs/meshery-extensions-packages/.github/workflows/notify-email.yml@master | ||
secrets: | ||
token: ${{ secrets.GH_ACCESS_TOKEN }} | ||
MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }} | ||
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} | ||
with: | ||
release-tag: ${{github.ref_name}} | ||
to: [email protected] | ||
call-cncf-playground-rollout: | ||
needs: | ||
- build | ||
name: Deploy CNCF Playground | ||
uses: meshery/meshery/.github/workflows/cncf-playground-deploy-meshery.yaml@master | ||
secrets: inherit | ||
|
||
email-on-failure: | ||
needs: [update-rest-api-docs, update-graphql-docs, build, ctlrelease, call-dde-release-workflow, call-helm-chart-releaser, email-meshery-release-notes-workflow, call-cncf-playground-rollout] | ||
if: ${{ failure() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Find failed jobs. | ||
run: | | ||
curl "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" | jq -r '.jobs[] | select(.conclusion == "failure") | "\(.name): \(.steps[] | select(.conclusion == "failure") | .name)\n\(.html_url)\n"' >> output.txt | ||
# Save multi-line environment variables by using the delimiters syntex. | ||
echo "EMAIL_BODY<<EOF" >> $GITHUB_ENV | ||
echo "$(cat ./output.txt)" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Failed jobs summary | ||
run: | | ||
echo "${{ env.EMAIL_BODY }}" | ||
- name: Send Email Notification | ||
if: env.EMAIL_BODY != '' | ||
uses: dawidd6/action-send-mail@v3 | ||
with: | ||
server_address: smtp.gmail.com | ||
server_port: 465 | ||
username: ${{ secrets.MAIL_USERNAME }} | ||
password: ${{ secrets.MAIL_PASSWORD }} | ||
subject: Job(s) failure in the build-and-release-stable workflow | ||
to: [email protected] | ||
from: Build and Release Stable workflow | ||
body: | | ||
The workflow failed. Here are the details: | ||
${{ env.EMAIL_BODY }} | ||
Workflow run log URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |