Skip to content

Commit

Permalink
Trying something new
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Jul 1, 2024
1 parent 891bd73 commit 3f90339
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f90339

Please sign in to comment.