67 lines
2.0 KiB
YAML
67 lines
2.0 KiB
YAML
name: Build Client to Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'client/**'
|
|
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: '20'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
working-directory: client
|
|
|
|
- name: Build for Linux x64
|
|
run: npm run pkglinux:x64
|
|
working-directory: client
|
|
|
|
- name: Install QEMU # 设置qemu 支持arm的虚拟环境
|
|
run: sudo apt-get update && sudo apt-get install -y qemu qemu-user-static binfmt-support
|
|
|
|
- name: Setup QEMU ARM64
|
|
run: |
|
|
sudo update-binfmts --enable qemu-aarch64
|
|
sudo cp /usr/bin/qemu-aarch64-static /usr/local/bin
|
|
uname -a
|
|
|
|
- name: Build for Linux arm64
|
|
run: npm run pkglinux:arm64
|
|
working-directory: client
|
|
|
|
- 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: dist/easynode-client-x86
|
|
asset_name: easynode-client-x86
|
|
asset_content_type: application/octet-stream
|
|
|
|
- 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: dist/easynode-client-arm64
|
|
asset_name: easynode-client-arm64
|
|
asset_content_type: application/octet-stream
|