Skip to content

[Server] send vmac to agent #22202 #694

[Server] send vmac to agent #22202

[Server] send vmac to agent #22202 #694

Workflow file for this run

name: build cli
on:
push:
branches:
- v6.1
paths:
- 'cli/**'
tags:
- '*'
workflow_dispatch:
inputs:
ref:
description: "Why trigger?"
required: true
type: string
# release:
# branches:
# - main
# - release-*
jobs:
build_cli:
name: build cli
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.18.x
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.6.1'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: build cli
run: |
sudo apt-get install tmpl
pip install ujson
GO111MODULE="off" go get github.com/gogo/protobuf/protoc-gen-gofast
GO111MODULE="off" go get github.com/gogo/protobuf/proto
GO111MODULE="off" go get github.com/gogo/protobuf/jsonpb
GO111MODULE="off" go get github.com/gogo/protobuf/protoc-gen-gogo
GO111MODULE="off" go get github.com/gogo/protobuf/gogoproto
GO111MODULE="off" go get github.com/golang/protobuf/protoc-gen-go
GO111MODULE="off" go get golang.org/x/tools/cmd/stringer
cd cli
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make -e BINARY_SUFFIX=.linux-amd64 -e BRANCH=${{ github.ref_name }}
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 make -e BINARY_SUFFIX=.linux-arm64 -e BRANCH=${{ github.ref_name }}
# CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 make -e BINARY_SUFFIX=.darwin-amd64
# CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 make -e BINARY_SUFFIX=.darwin-arm64
cd bin/
sha256sum * > deepflow-agent.sha256sum.txt
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: deepflow-cli
path: ./cli/bin/*
- uses: manyuanrong/[email protected]
with:
endpoint: "oss-accelerate.aliyuncs.com"
access-key-id: "${{ secrets.ALIYUN_OSS_ACCESS_KEY }}"
access-key-secret: "${{ secrets.ALIYUN_OSS_SECRETS_KEY }}"
- name: set env
run: |
echo "IMAGE_TAG_PREFIX=${{ github.ref_name }}"|sed 's|main|latest|' >> $GITHUB_ENV
echo "IMAGE_TAG=$(git rev-list --count HEAD)" >> $GITHUB_ENV
- name: upload cli
run: |
ossutil cp -rf cli/bin/deepflow-ctl.linux-amd64 oss://deepflow-ce/bin/ctl/${{ env.IMAGE_TAG_PREFIX }}/linux/amd64/deepflow-ctl
ossutil cp -rf cli/bin/deepflow-ctl.linux-arm64 oss://deepflow-ce/bin/ctl/${{ env.IMAGE_TAG_PREFIX }}/linux/arm64/deepflow-ctl
# ossutil cp -rf cli/bin/deepflow-ctl.darwin-amd64 oss://deepflow-ce/bin/ctl/${{ env.IMAGE_TAG_PREFIX }}/osx/amd64/deepflow-ctl
# ossutil cp -rf cli/bin/deepflow-ctl.darwin-arm64 oss://deepflow-ce/bin/ctl/${{ env.IMAGE_TAG_PREFIX }}/osx/arm64/deepflow-ctl
- name: upload cli v6.1.8 artifacts
if: "startsWith(github.ref, 'refs/tags/')"
run: |
ossutil cp -rf cli/bin/deepflow-ctl.linux-amd64 oss://deepflow-ce/bin/ctl/v6.1.8/linux/amd64/deepflow-ctl
ossutil cp -rf cli/bin/deepflow-ctl.linux-arm64 oss://deepflow-ce/bin/ctl/v6.1.8/linux/arm64/deepflow-ctl
# - name: Prepare for upload package
# shell: bash
# run: |
# sha256sum dist/* > deepflow-agent.sha256sum.txt
# - name: Release and upload packages
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# files: |
# deepflow-agent.sha256sum.txt
# dist/*