Feat/0.3.2 (#714) #557
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
# name: release | |
# on: | |
# push: | |
# # Sequence of patterns matched against refs/tags | |
# branches: | |
# - "release" | |
# env: | |
# DOCKERHUB_REPO: dataelement/ | |
# PY_NEXUS: 110.16.193.170:50083 | |
# DOCKER_NEXUS: 110.16.193.170:50080 | |
# concurrency: | |
# group: ${{ github.workflow }}-${{ github.ref }} | |
# cancel-in-progress: true | |
# jobs: | |
# build: | |
# runs-on: ubuntu-latest | |
# #if: startsWith(github.event.ref, 'refs/tags') | |
# steps: | |
# # deploy | |
# - name: checkout | |
# uses: actions/checkout@v2 | |
# - name: Process git message | |
# id: process_message | |
# run: | | |
# value=$(echo "${{ github.event.head_commit.message }}" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/%0A/g' ) | |
# echo "message=${value}" >> $GITHUB_ENV | |
# shell: bash | |
# - name: notify feishu | |
# uses: fjogeleit/http-request-action@v1 | |
# with: | |
# url: ' https://open.feishu.cn/open-apis/bot/v2/hook/2cfe0d8d-647c-4408-9f39-c59134035c4b' | |
# method: 'POST' | |
# data: '{"msg_type":"post","content":{"post":{"zh_cn":{"title": "${{github.event.pusher.name}}提交代码,开始编译", "content": [[{"tag":"text","text":"发布功能:"},{"tag":"text","text":"${{ env.message }}"}]]}}}}' | |
# - name: Set Environment Variable | |
# run: echo "RELEASE_VERSION=99.99.99" >> $GITHUB_ENV | |
# - name: Set python version 3.8 | |
# uses: actions/setup-python@v1 | |
# with: | |
# python-version: 3.8 | |
# - name: Build PyPi bisheng-langchain and push | |
# id: pypi_build_bisheng_langchain | |
# run: | | |
# pip install Cython | |
# pip install wheel | |
# pip install twine | |
# cd ./src/bisheng-langchain | |
# python setup.py bdist_wheel | |
# repo="http://${{ env.PY_NEXUS }}/repository/pypi-hosted/" | |
# twine upload --verbose -u ${{ secrets.NEXUS_USER }} -p ${{ secrets.NEXUS_PASSWORD }} --repository-url $repo dist/*.whl | |
# cd ../../ | |
# - name: Set up QEMU | |
# uses: docker/setup-qemu-action@v1 | |
# - name: set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
# # 发布到 私有仓库 | |
# - name: set insecure registry | |
# run: | | |
# echo "{ \"insecure-registries\": [\"http://${{ env.DOCKER_NEXUS }}\"] }" | sudo tee /etc/docker/daemon.json | |
# sudo service docker restart | |
# # - name: Set up QEMU | |
# # uses: docker/setup-qemu-action@v1 | |
# - name: Login Nexus Container Registry | |
# uses: docker/login-action@v2 | |
# with: | |
# registry: http://${{ env.DOCKER_NEXUS }}/ | |
# username: ${{ secrets.NEXUS_USER }} | |
# password: ${{ secrets.NEXUS_PASSWORD }} | |
# # 替换poetry编译为私有服务 | |
# - name: replace self-host repo | |
# uses: snok/install-poetry@v1 | |
# with: | |
# installer-parallel: true | |
# - name: build lock | |
# run: | | |
# cd ./src/backend | |
# sed -i 's/^bisheng_langchain.*/bisheng_langchain = "'$RELEASE_VERSION'"/g' pyproject.toml | |
# poetry source add --priority=supplemental foo http://${{ secrets.NEXUS_PUBLIC }}:${{ secrets.NEXUS_PUBLIC_PASSWORD }}@${{ env.PY_NEXUS }}/repository/pypi-group/simple | |
# poetry lock | |
# cd ../../ | |
# # 构建 backend 并推送到 Docker hub | |
# - name: Build backend and push | |
# id: docker_build_backend | |
# uses: docker/build-push-action@v2 | |
# with: | |
# # backend 的context目录 | |
# context: "./src/backend/" | |
# # 是否 docker push | |
# push: true | |
# platforms: linux/amd64,linux/arm64 | |
# # docker build arg, 注入 APP_NAME/APP_VERSION | |
# build-args: | | |
# APP_NAME="bisheng-backend" | |
# APP_VERSION="release" | |
# # 生成两个 docker tag: ${APP_VERSION} 和 latest | |
# tags: | | |
# ${{ env.DOCKER_NEXUS }}/${{ env.DOCKERHUB_REPO }}bisheng-backend:release | |
# # 构建 Docker frontend 并推送到 Docker hub | |
# - name: Build frontend and push | |
# id: docker_build_frontend | |
# uses: docker/build-push-action@v2 | |
# with: | |
# # frontend 的context目录 | |
# context: "./src/frontend/" | |
# # 是否 docker push | |
# push: true | |
# platforms: linux/amd64,linux/arm64 | |
# # docker build arg, 注入 APP_NAME/APP_VERSION | |
# build-args: | | |
# APP_NAME="bisheng-frontend" | |
# APP_VERSION="release" | |
# # 生成两个 docker tag: ${APP_VERSION} 和 latest | |
# tags: | | |
# ${{ env.DOCKER_NEXUS }}/${{ env.DOCKERHUB_REPO }}bisheng-frontend:release | |
# # deploy | |
# - name: notify feishu | |
# uses: fjogeleit/http-request-action@v1 | |
# with: | |
# url: ' https://open.feishu.cn/open-apis/bot/v2/hook/2cfe0d8d-647c-4408-9f39-c59134035c4b' | |
# method: 'POST' | |
# data: '{"msg_type":"text","content":{"text":"release 编译成功, 准备部署"}}' | |
# - name: Deploy Stage | |
# uses: fjogeleit/http-request-action@v1 | |
# with: | |
# timeout: 200000 | |
# url: 'https://bisheng.dataelem.com/deploy/cgi-bin/deploy_script.py' | |
# method: 'GET' | |
# - name: notify feishu | |
# uses: fjogeleit/http-request-action@v1 | |
# with: | |
# url: ' https://open.feishu.cn/open-apis/bot/v2/hook/2cfe0d8d-647c-4408-9f39-c59134035c4b' | |
# method: 'POST' | |
# data: '{"msg_type":"text","content":{"text":"release 部署成功"}}' |