👷 监控客户端自动化构建

This commit is contained in:
chaos-zhu 2024-08-16 11:21:30 +08:00
parent c3a689cc96
commit ae6c72115f
2 changed files with 60 additions and 1 deletions

59
.github/workflows/client-builder.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: Build and Upload to Release
on:
push:
branches:
- main
paths:
- 'clients/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
working-directory: ./clients
- name: Build for Linux x86
run: npm run pkglinux:x86
working-directory: ./clients
- name: Build for Linux ARM64
run: npm run pkglinux:arm
working-directory: ./clients
- name: Get the latest release ID
id: get_release
run: echo "RELEASE_ID=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .id)" >> $GITHUB_ENV
- name: Upload Linux x86 Binary to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets
asset_path: ./clients/dist/easynode-client-x86
asset_name: easynode-client-x86
asset_content_type: application/octet-stream
overwrite: true
- name: Upload Linux ARM64 Binary to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets
asset_path: ./clients/dist/easynode-client-arm64
asset_name: easynode-client-arm64
asset_content_type: application/octet-stream
overwrite: true

View File

@ -3,7 +3,7 @@ name: Docker Build and Push
on:
release:
types: [published]
workflow_dispatch: # 手动构建
workflow_dispatch:
inputs:
tag_name:
description: 'Tag Name (leave empty for default latest)'