Build Multi-Platform Prod #37
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: Build Multi-Platform Prod | |
on: | |
push: | |
tags: | |
- "v*-*" | |
- "!v*-render" | |
- "!v*-sast-render" | |
- "!v*-sast" | |
jobs: | |
build_yakit: | |
runs-on: macos-13 | |
env: | |
CI: "" | |
NODE_OPTIONS: --max_old_space_size=4096 | |
APPLE_ID: ${{ secrets.APPLE_ACCOUNT_EMAIL }} | |
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
APPLE_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }} | |
CERT_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }} | |
CERT_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.18.2 | |
- run: echo ${{ github.ref_name }} | |
- run: cp buildutil/zip /usr/local/bin/zip | |
- run: chmod +x /usr/local/bin/zip | |
- run: zip -h | |
- name: "Download yakit-chrome-extension" | |
run: | | |
extensionVersion=$(curl -fsL "http://yaklang.oss-accelerate.aliyuncs.com/chrome-extension/latest-version.txt") || { | |
echo "Failed to download!" >&2 | |
exit 1 | |
} | |
wget -O bins/scripts/google-chrome-plugin.zip https://oss-qn.yaklang.com/chrome-extension/yakit-chrome-extension-v${extensionVersion}.zip | |
shell: bash | |
- name: "Fetch Latest Engine Version And Set To Env" | |
run: | | |
wget -O bins/engine-version.txt https://yaklang.oss-accelerate.aliyuncs.com/yak/latest/version.txt | |
cat bins/engine-version.txt | |
YAK_VERSION=$(cat bins/engine-version.txt | tr -d '\n') | |
echo "ENGINE_VERSION=$YAK_VERSION" >> $GITHUB_ENV | |
- name: "Download Yak Engine via wget(Linux)" | |
id: download-linux-engine | |
run: wget -O bins/yak_linux_amd64 https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_linux_amd64 && zip ./bins/yak_linux_amd64.zip ./bins/yak_linux_amd64 && rm ./bins/yak_linux_amd64 | |
- name: "Download Yak Engine via wget(Linux-arm64)" | |
id: download-linux-engine-arm64 | |
run: wget -O bins/yak_linux_arm64 https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_linux_arm64 && zip ./bins/yak_linux_arm64.zip ./bins/yak_linux_arm64 && rm ./bins/yak_linux_arm64 | |
- name: "Download Yak Engine via wget(Windows)" | |
id: download-windows-engine | |
run: wget -O bins/yak_windows_amd64.exe https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_windows_amd64.exe && zip ./bins/yak_windows_normal_amd64.zip ./bins/yak_windows_amd64.exe && rm ./bins/yak_windows_amd64.exe | |
- name: "Download Yak Legacy Engine via wget(Windows)" | |
id: download-windows-leagacy-engine | |
run: wget -O bins/yak_windows_amd64.exe https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_windows_legacy_amd64.exe && zip ./bins/yak_windows_legacy_amd64.zip ./bins/yak_windows_amd64.exe && rm ./bins/yak_windows_amd64.exe | |
- name: "Download Yak Engine via wget(MacOS)" | |
id: download-darwin-engine | |
run: wget -O bins/yak_darwin_amd64 https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_darwin_amd64 | |
- name: "Download Yak Engine via wget(MacOS-arm64)" | |
id: download-darwin-engine-arm64 | |
run: wget -O bins/yak_darwin_arm64 https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_darwin_arm64 | |
- name: Signature Mac Engine | |
run: chmod +x ./packageScript/script/signature.sh && ./packageScript/script/signature.sh | |
shell: bash | |
- name: "Fetch Mac-Amd Sha256" | |
run: wget -O bins/yak_darwin_amd64.sha256.txt https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_darwin_amd64.sha256.txt | |
- name: "Fetch Mac-Arm Sha256" | |
run: wget -O bins/yak_darwin_arm64.sha256.txt https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_darwin_arm64.sha256.txt | |
- name: Echo Yakit Package Version To Env | |
run: echo "ENV_TAG=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV | |
shell: bash | |
- run: yarn install | |
working-directory: ./ | |
name: "Install Dependencies" | |
- name: Build pre script | |
run: chmod +x ./packageScript/script/buildPreScript.sh && ./packageScript/script/buildPreScript.sh yakit | |
shell: bash | |
- name: Build Yakit Normal And Legacy (MultiPlatform) | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
working-directory: ./ | |
run: ./packageScript/script/electron-builder.sh ce || { exit 1; } | |
shell: bash | |
- name: View Published Content | |
run: | |
ls ./release | |
# Yakit -1.3.4-sp6-darwin-arm64(.dmg|.exe|.AppImage) | |
- name: Check Yakit if the output is correct | |
run: (./packageScript/script/check-build-package.sh Yakit) || { exit 1; } | |
shell: bash | |
- name: Upload Yakit(CE) Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Yakit-artifacts | |
path: | | |
./release/Yakit-${{ env.ENV_TAG }}-*.exe | |
./release/Yakit-${{ env.ENV_TAG }}-*.dmg | |
./release/Yakit-${{ env.ENV_TAG }}-*.AppImage | |
if-no-files-found: error | |
retention-days: 1 | |
- name: Build EnpriTrace Normal And Legacy (MultiPlatform) | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
working-directory: ./ | |
run: ./packageScript/script/electron-builder.sh ee || { exit 1; } | |
shell: bash | |
- name: View Published Content | |
run: | |
ls ./release | |
# EnpriTrace -1.3.4-sp6-darwin-arm64(.dmg|.exe|.AppImage) | |
- name: Check EnpriTrace if the output is correct | |
run: (./packageScript/script/check-build-package.sh EnpriTrace) || { exit 1; } | |
shell: bash | |
- name: Upload Yakit(EE) Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: EnpriTrace-artifacts | |
path: | | |
./release/EnpriTrace-${{ env.ENV_TAG }}-*.exe | |
./release/EnpriTrace-${{ env.ENV_TAG }}-*.dmg | |
./release/EnpriTrace-${{ env.ENV_TAG }}-*.AppImage | |
if-no-files-found: error | |
retention-days: 1 | |
publish_software_to_oss: | |
needs: | |
- build_yakit | |
strategy: | |
matrix: | |
artifact: [Yakit, EnpriTrace] # 需要发布的软件名前缀 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo Package Version To Env | |
run: echo "ENV_TAG=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV | |
- name: Download Yakit And Legacy Yakit | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.artifact }}-artifacts | |
merge-multiple: true | |
- run: ls | |
name: Ls Published Artifacts... | |
- name: Create Release and Upload Assets | |
if: ${{ matrix.artifact == 'Yakit' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ./* | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: Release ${{ github.ref_name }} | |
tag: ${{ github.ref_name }} | |
- name: Generate OSS File Path | |
run: | | |
if [ "${{ matrix.artifact }}" = "Yakit" ]; then | |
echo "FILE_PATH=yak" >> $GITHUB_ENV | |
elif [ "${{ matrix.artifact }}" = "EnpriTrace" ]; then | |
echo "FILE_PATH=vip" >> $GITHUB_ENV | |
else | |
echo "No corresponding file path" >&2 | |
exit 1 | |
fi | |
- name: Show ENV.FILE_PATH | |
run: echo "FILE_PATH: $FILE_PATH" | |
- name: Upload Yakit To OSS | |
uses: tvrcgo/upload-to-oss@master | |
with: | |
key-id: ${{ secrets.OSS_KEY_ID }} | |
key-secret: ${{ secrets.OSS_KEY_SECRET }} | |
region: oss-accelerate | |
bucket: yaklang | |
assets: | | |
*:/${{ env.FILE_PATH }}/${{ env.ENV_TAG }}/ |