Skip to content

Fix Windows executable upload #21

Fix Windows executable upload

Fix Windows executable upload #21

name: Build Binaries
on:
push:
branches:
- daniel/infisical-binary
pull_request:
branches:
- daniel/infisical-binary
defaults:
run:
working-directory: ./backend
jobs:
build-and-release:
runs-on: ubuntu-20.04
strategy:
matrix:
arch: [x64, arm64]
os: [linux, win]
include:
- os: linux
target: node18-linux
- os: win
target: node18-win
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pkg
run: npm install -g pkg
- name: Install dependencies (backend)
run: npm install
working-directory: ./backend
- name: Install dependencies (frontend)
run: npm install --prefix ../frontend
working-directory: ./backend
- name: Prerequisites for pkg
run: npm run binary:build
working-directory: ./backend
- name: Package into node binary
run: pkg --no-bytecode --public-packages "*" --public --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} .
working-directory: ./backend
- name: List files
run: ls -la ./binary
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: infisical-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ format('backend/binary/infisical-{}-{}{}', matrix.os, matrix.arch, matrix.os == 'windows-latest' && '.exe' || '') }}