From ae6c72115fd4fd0c7ea1d2f1b0b5554b68ca7ec0 Mon Sep 17 00:00:00 2001 From: chaos-zhu Date: Fri, 16 Aug 2024 11:21:30 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E8=87=AA=E5=8A=A8=E5=8C=96=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/client-builder.yml | 59 +++++++++++++++++++ .../{docker-build.yml => docker-builder.yml} | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/client-builder.yml rename .github/workflows/{docker-build.yml => docker-builder.yml} (96%) diff --git a/.github/workflows/client-builder.yml b/.github/workflows/client-builder.yml new file mode 100644 index 0000000..8d2abb9 --- /dev/null +++ b/.github/workflows/client-builder.yml @@ -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 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-builder.yml similarity index 96% rename from .github/workflows/docker-build.yml rename to .github/workflows/docker-builder.yml index f3043a6..7434b01 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-builder.yml @@ -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)'