Skip to content

Commit

Permalink
Update build-binaries.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Jul 23, 2024
1 parent f9eaee4 commit 041706d
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,24 @@ defaults:

jobs:
build-and-deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container: "debian:buster"
strategy:
matrix:
arch: [x64, arm64]
os: [linux, win]
include:
- os: linux
target: node20-linux
- os: win
target: node20-win
target: node18-linux
# - os: win
# target: node18-win
env:
npm_config_arch: ${{ matrix.arch }}
# Not doing this results in argon2 seemingly being built as x86_64 on arm64.
npm_config_build_from_source: true

# Only relevant for arm64 linux builds
TARGET_ARCH: arm64

steps:
- name: Checkout code
Expand All @@ -32,7 +40,21 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 18

- name: Install cross-compiler and system dependencies
if: matrix.arch == 'arm64'
run: |
dpkg --add-architecture $TARGET_ARCH
apt-get update && apt-get install -y --no-install-recommends \
crossbuild-essential-$TARGET_ARCH \
libx11-dev:$TARGET_ARCH \
libx11-xcb-dev:$TARGET_ARCH \
libxkbfile-dev:$TARGET_ARCH \
libsecret-1-dev:$TARGET_ARCH \
libkrb5-dev:$TARGET_ARCH \
ca-certificates \
curl wget rsync gettext-base
- name: Install pkg
run: npm install -g @yao-pkg/pkg
Expand Down Expand Up @@ -86,14 +108,20 @@ jobs:
- uses: actions/setup-python@v4
- run: pip install --upgrade cloudsmith-cli

- uses: actions/upload-artifact@v4
if: matrix.arch == 'arm64'
with:
name: test-binary
path: ./binary/infisical-core-${{ matrix.arch }}.deb

# Publish .deb file to Cloudsmith (Debian/Ubuntu only)
- name: Publish to Cloudsmith (Debian/Ubuntu)
if: matrix.os == 'linux'
working-directory: ./backend
run: cloudsmith push deb --republish --no-wait-for-sync --api-key=${{ secrets.CLOUDSMITH_API_KEY }} infisical/infisical-core/any-distro/any-version ./binary/infisical-core-${{ matrix.arch }}.deb

# Publish .exe file to Cloudsmith (Windows only)
- name: Publish to Cloudsmith (Windows)
if: matrix.os == 'win'
working-directory: ./backend
run: cloudsmith push raw infisical/infisical-core ./binary/infisical-core-${{ matrix.os }}-${{ matrix.arch }}.exe --republish --no-wait-for-sync --version ${{ github.event.inputs.version }} --api-key ${{ secrets.CLOUDSMITH_API_KEY }}
# - name: Publish to Cloudsmith (Debian/Ubuntu)
# if: matrix.os == 'linux'
# working-directory: ./backend
# run: cloudsmith push deb --republish --no-wait-for-sync --api-key=${{ secrets.CLOUDSMITH_API_KEY }} infisical/infisical-core/any-distro/any-version ./binary/infisical-core-${{ matrix.arch }}.deb

# # Publish .exe file to Cloudsmith (Windows only)
# - name: Publish to Cloudsmith (Windows)
# if: matrix.os == 'win'
# working-directory: ./backend
# run: cloudsmith push raw infisical/infisical-core ./binary/infisical-core-${{ matrix.os }}-${{ matrix.arch }}.exe --republish --no-wait-for-sync --version ${{ github.event.inputs.version }} --api-key ${{ secrets.CLOUDSMITH_API_KEY }}

0 comments on commit 041706d

Please sign in to comment.