Build Multi-Platform Prod #18
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*" | |
jobs: | |
build_yakit: | |
runs-on: macos-13 | |
env: | |
CI: "" | |
NODE_OPTIONS: --max_old_space_size=4096 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.18.2 | |
- run: echo ${{ github.ref }} | |
- run: cp buildutil/zip /usr/local/bin/zip | |
- run: chmod +x /usr/local/bin/zip | |
- run: zip -h | |
- name: "Fetch Latest EngineVersion" | |
run: wget -O bins/engine-version.txt https://oss-qn.yaklang.com/yak/latest/version.txt | |
- run: | | |
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(MacOS)" | |
id: download-darwin-engine | |
run: wget -O bins/yak_darwin_amd64 https://oss-qn.yaklang.com/yak/${ENGINE_VERSION}/yak_darwin_amd64 && zip ./bins/yak_darwin_amd64.zip ./bins/yak_darwin_amd64 && rm ./bins/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 && zip ./bins/yak_darwin_arm64.zip ./bins/yak_darwin_arm64 && rm ./bins/yak_darwin_arm64 | |
- 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: 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 Yakit Normal And Legacy (MultiPlatform) | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
working-directory: ./ | |
run: chmod +x ./scripts/electron-build.sh && ./scripts/electron-build.sh | |
shell: bash | |
- name: View Published Content | |
run: | |
ls ./release | |
# EnpriTraceAgent -1.3.4-sp6-darwin-arm64(.dmg|.exe|.AppImage) | |
# EnpriTrace -1.3.4-sp6-darwin-arm64(.dmg|.exe|.AppImage) | |
# Yakit -1.3.4-sp6-darwin-arm64(.dmg|.exe|.AppImage) | |
- name: Check Yakit if the output is correct | |
run: chmod +x ./scripts/check-build-package.sh && ./scripts/check-build-package.sh Yakit | |
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: Check EnpriTrace if the output is correct | |
run: ./scripts/check-build-package.sh EnpriTrace | |
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 }}/ |