Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build-and-release-stable.yml #1

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/build-and-release-dde.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,47 +60,3 @@ jobs:
echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV
echo "GIT_STRIPPED_VERSION=$GIT_STRIPPED_VERSION" >> $GITHUB_ENV
shell: bash

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Meta
id: meta
uses: docker/metadata-action@v3
with:
images: meshery/docker-extension-meshery
flavor: |
latest=true
tags: |
type=raw,value=${{env.RELEASE_CHANNEL}}-{{sha}}
type=semver,pattern={{version}},value=${{env.GIT_STRIPPED_VERSION}}
type=raw,value=${{env.RELEASE_CHANNEL}}-{{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,value=${{env.RELEASE_CHANNEL}}-latest
type=raw,value=${{env.RELEASE_CHANNEL}}-${{env.GIT_VERSION}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: "{{defaultContext}}:install/docker-extension"
push: true
build-args: |
GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}}
GIT_VERSION=${{env.GIT_VERSION}}
RELEASE_CHANNEL=${{env.RELEASE_CHANNEL}}
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64

# -
# name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# repository: meshery/meshery-docker-extension
# readme-filepath: /install/docker-extension/README.md

215 changes: 0 additions & 215 deletions .github/workflows/build-and-release-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Loading