Merge pull request #11341 from TencentBlueKing/changelog/v3.1.0-rc.5 #385
Workflow file for this run
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: Tag Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
frontend: | |
name: Build frontend | |
with: | |
upload: true | |
uses: ./.github/workflows/frontend.yml | |
agent: | |
name: Build agent | |
with: | |
upload: true | |
uses: ./.github/workflows/agent.yml | |
backend: | |
name: Build backend | |
with: | |
upload: true | |
uses: ./.github/workflows/backend.yml | |
package-zip: | |
name: Package Zip | |
runs-on: ubuntu-20.04 | |
needs: [frontend, agent, backend] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: download frontend | |
uses: actions/[email protected] | |
with: | |
name: frontend | |
path: src/frontend/frontend | |
- name: download agent | |
uses: actions/[email protected] | |
with: | |
name: agent | |
path: src/agent/agent/bin/ | |
- name: download backend | |
uses: actions/[email protected] | |
with: | |
name: backend-jar | |
path: src/backend/ci/release | |
- name: make package | |
run: | | |
version="$(basename $GITHUB_REF)" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
ci_ms_wip="sign,monitoring" ci_pkg_dir=/dev/shm/ci ./scripts/packager-ci.sh "$version" bkci-slim.tar.gz | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: bkci-slim | |
path: bkci-slim.tar.gz | |
package-docker: | |
name: Package Docker | |
runs-on: ubuntu-20.04 | |
needs: [frontend, agent, backend] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: download frontend | |
uses: actions/[email protected] | |
with: | |
name: frontend | |
path: src/frontend/frontend | |
- name: download agent | |
uses: actions/[email protected] | |
with: | |
name: agent | |
path: src/agent/agent/bin/ | |
- name: download bkci | |
uses: actions/[email protected] | |
with: | |
name: backend-docker | |
path: src/backend/ci/release | |
- name: make package | |
run: | | |
version="$(basename $GITHUB_REF)" | |
echo "version=$version" >> $GITHUB_OUTPUT | |
ci_ms_wip="sign" ci_pkg_dir=/dev/shm/ci-docker ./scripts/packager-ci.sh "$version" bkci-docker.tar.gz | |
- name: Setup Docker -- CLOUD NATIVE | |
uses: docker-practice/actions-setup-docker@master | |
- name: Create Docker Image -- CLOUD NATIVE | |
working-directory: docker-images/core/ci | |
run: | | |
version="$(basename $GITHUB_REF)" | |
docker login --username=${{ secrets.DOCKER_USER }} --password=${{ secrets.DOCKER_PASS }} ${{ secrets.DOCKER_HOST }} | |
./0.get_release.sh | |
./1.build_gateway_image.sh ${{ secrets.DOCKER_IMAGE_REGISTRY }} $version | |
./2.build_backend_bkci_image.sh ${{ secrets.DOCKER_IMAGE_REGISTRY }} $version | |
./3.build_frontend_image.sh ${{ secrets.DOCKER_IMAGE_REGISTRY }} $version | |
package-helm: | |
name: Package Helm | |
runs-on: ubuntu-20.04 | |
needs: [frontend, agent, backend] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python -- CLOUD NATIVE | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.7.15" | |
- name: Generate Helm Chart -- CLOUD NATIVE | |
working-directory: helm-charts/core/ci | |
run: | | |
version="$(basename $GITHUB_REF)" | |
echo 'python build' | |
pip install pyhumps | |
pip install PyYAML | |
python build_chart.py ${{ secrets.DOCKER_IMAGE_REGISTRY }} $version $version $version | |
- name: Install Helm -- CLOUD NATIVE | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.8.1 | |
- name: Package Helm Chart -- CLOUD NATIVE | |
working-directory: helm-charts/core/ci | |
run: | | |
version="$(basename $GITHUB_REF)" | |
helm package . --version $version --app-version $version | |
mv bk-ci-$version.tgz bk-ci-charts.tgz | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: bkci-chart | |
path: helm-charts/core/ci/bk-ci-charts.tgz | |
releaseAll: | |
name: Release All | |
runs-on: ubuntu-20.04 | |
needs: [package-zip, package-helm] | |
steps: | |
- name: download bkci-slim | |
uses: actions/[email protected] | |
with: | |
name: bkci-slim | |
path: ./ | |
- name: download bkci-chart | |
uses: actions/[email protected] | |
with: | |
name: bkci-chart | |
path: ./ | |
- name: get change log file | |
id: get_version_file | |
run: | | |
version=${{ github.ref_name }} | |
version=$(echo ${version:1}) | |
version=`echo $version | sed 's/-/./g'` | |
major=`echo $version | cut -d. -f1` | |
minor=`echo $version | cut -d. -f2` | |
echo "version_file=CHANGELOG/CHANGELOG-$major.$minor.md" | |
echo "version_file=CHANGELOG/CHANGELOG-$major.$minor.md" >> $GITHUB_OUTPUT | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/[email protected] | |
with: | |
name: "bk-ci ${{ github.ref_name }}" | |
draft: true | |
prerelease: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: "See <a href='https://github.com/TencentBlueKing/bk-ci/blob/master/${{steps.get_version_file.outputs.version_file}}'>the CHANGELOG</a> for more details." | |
artifacts: "bkci-slim.tar.gz,bk-ci-charts.tgz" |