bugfix: 2.0.0 版本二进制部署问题修复 #24
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: | |
codecc: | |
name: Build CodeCC | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-read-only: false | |
- name: Gradle Build | |
id: codecc-backend | |
working-directory: src/backend/codecc | |
run: | | |
chmod +x gradlew | |
./gradlew clean copyToRelease --refresh-dependencies | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: checkout gateway | |
uses: actions/checkout@v4 | |
with: | |
repository: TencentBlueKing/bk-ci | |
ref: v2.0.2 | |
path: bk-ci | |
- name: gateway package | |
id: codecc-gateway-package | |
run: | | |
ls bk-ci | |
mv bk-ci/src/gateway/core src/gateway/core | |
rm -rf bk-ci | |
- name: frontend | |
id: codecc-frontend | |
run: | | |
cd src/frontend/devops-codecc | |
rm -rf dist | |
npm i --force && npm run build | |
if [ -f dist/index.html ]; then | |
mv dist/index.html dist/frontend#index.html | |
fi | |
- name: Create artifact - make package | |
id: create-artifact | |
run: | | |
version="$(basename $GITHUB_REF)" | |
echo "::set-output name=version::$version" | |
chmod +x scripts/deploy-codecc/* | |
codecc_pkg_dir=/dev/shm/codecc ./scripts/deploy-codecc/packager-codecc.sh "$version" bkcodecc-slim.tar.gz "$PWD" | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: codecc | |
path: bkcodecc-slim.tar.gz | |
releaseAll: | |
name: Release All | |
runs-on: ubuntu-20.04 | |
if: ${{ always() }} | |
needs: [codecc] | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: bk-codecc ${{ github.ref }} | |
draft: true | |
prerelease: true | |
## codecc | |
- name: download codecc | |
uses: actions/download-artifact@v1 | |
with: | |
name: codecc | |
path: ./ | |
- name: Upload Release Asset -- CODECC | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./bkcodecc-slim.tar.gz | |
asset_name: bkcodecc-slim.tar.gz | |
asset_content_type: application/gzip |