From 3f9033966f9d8d8f9ac89a59e74968a326769eb9 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:29:48 +0200 Subject: [PATCH] Trying something new --- .github/workflows/build-binaries.yml | 53 ++++++++++++++-------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index bb3d11a7ba..a02c319066 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -17,39 +17,38 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - arch: - - x64 - - arm64 - node-version: - - 18 - os: - - linux - - macos - - win + arch: [x64, arm64] + os: [linux, macos, win] + include: + - os: linux + docker-image: node:18-buster + - os: macos + docker-image: node:18-buster + - os: win + docker-image: node:18-buster steps: - name: Checkout code uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install pkg - run: npm install -g pkg - - - name: Install dependencies (backend) - run: npm install + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - - name: Install dependencies (frontend) - run: npm install --prefix ../frontend - - - name: Prerequisites for pkg - run: npm run binary:build - - - name: Package into node binary - run: pkg --no-bytecode --public-packages \"*\" --public --target host --output ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} . + - name: 🐋 Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build with Docker + run: | + docker run --rm \ + --platform=${{ matrix.os }} \ + -v ${{ github.workspace }}/backend:/workspace/backend \ + -v ${{ github.workspace }}/frontend:/workspace/frontend \ + -w /workspace/backend \ + ${{ matrix.docker-image }} \ + bash -c "npm install -g pkg && npm install && npm install --prefix ../frontend && npm run binary:build && pkg --no-bytecode --public-packages \"*\" --public --target node18-${{ matrix.os }}-${{ matrix.arch }} --output ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} ." - name: List files run: ls -la ./binary