This commit is contained in:
Daniel Hougaard
2024-07-06 01:32:18 +02:00
parent dfbeac3dfe
commit 36d30566fe
2 changed files with 29 additions and 55 deletions
+28 -54
View File
@@ -1,15 +1,9 @@
name: Build Binaries name: Build Binaries and Deploy
on: on:
# pull_request:
# branches:
# - daniel/infisical-binary
push: push:
branches: branches:
- daniel/infisical-binary - daniel/infisical-binary
# run for standalone releases
tags: tags:
- "infisical-standalone/v*.*.*" - "infisical-standalone/v*.*.*"
@@ -18,38 +12,29 @@ defaults:
working-directory: ./backend working-directory: ./backend
jobs: jobs:
build-and-release: build-and-deploy:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
# arch: [x64, arm64]
# os: [linux, alphine, win]
arch: [x64] arch: [x64]
os: [linux] os: [linux]
include: include:
- os: linux - os: linux
target: node18-linux target: node18-linux
# - os: win
# target: node18-win
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
# - name: Extract version from tag - name: Extract version from tag
# id: extract_version id: extract_version
# run: | run: |
# # Get the tag name if [[ $GITHUB_REF == refs/tags/* ]]; then
# TAG_NAME=$(git describe --tags) VERSION=${GITHUB_REF#refs/tags/infisical-standalone/v}
# # Extract the version part else
# VERSION=${TAG_NAME#infisical-standalone/v} VERSION=$(git rev-parse --short HEAD)
# echo "Extracted version is $VERSION" fi
# # Set the version as an output echo "version=$VERSION" >> $GITHUB_OUTPUT
# echo "::set-output name=version::$VERSION"
# - name: Version extration test
# run: |
# echo "The extracted version is ${{ steps.extract_version.outputs.version }}"
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
@@ -61,46 +46,35 @@ jobs:
- name: Install dependencies (backend) - name: Install dependencies (backend)
run: npm install run: npm install
working-directory: ./backend
- name: Install dependencies (frontend) - name: Install dependencies (frontend)
run: npm install --prefix ../frontend run: npm install --prefix ../frontend
working-directory: ./backend
- name: Prerequisites for pkg - name: Prerequisites for pkg
run: npm run binary:build run: npm run binary:build
working-directory: ./backend
- name: Package into node binary # --compress Brotli (Re-add before merging to main!) - name: Package into node binary
run: pkg --no-bytecode --public-packages "*" --public --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} . 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 - name: Build .deb package
run: ls -la ./binary
- name: Create .deb package
id: build-deb
if: matrix.os == 'linux' if: matrix.os == 'linux'
uses: ./.github/workflows/build-deb.yml uses: ./.github/workflows/build-deb.yml
with: with:
executable_path: ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} os: ${{ matrix.os }}
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
version: "3.0.0" version: ${{ steps.extract_version.outputs.version }}
executable_path: ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }}
- uses: actions/setup-python@v4 - name: Upload to Cloudsmith
- run: pip install --upgrade cloudsmith-cli
- name: Publish to Cloudsmith (Linux)
working-directory: ./backend
if: matrix.os == 'linux' if: matrix.os == 'linux'
run: cloudsmith push deb infisical/infisical-standalone/any-distro/any-version ${{ steps.build-deb.outputs.deb_path }} --republish --no-wait-for-sync --version 3.0.0 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} uses: cloudsmith-io/[email protected]
with:
# - name: Publish to Cloudsmith (Windows) api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
# working-directory: ./backend command: "push"
# if: matrix.os == 'win' format: "deb"
# run: cloudsmith push raw infisical/infisical-standalone ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }}.exe --republish --no-wait-for-sync --version 3.0.0 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} owner: "your-cloudsmith-org"
repo: "your-cloudsmith-repo"
# - name: Publish to Cloudsmith (Alphine) distro: "any-distro"
# working-directory: ./backend release: "any-release"
# if: matrix.os == 'alphine' republish: "true"
# run: cloudsmith push alpine infisical/infisical-standalone ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} --republish --no-wait-for-sync --version 3.0.0 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} file: ${{ steps.build-deb.outputs.deb_path }}
+1 -1
View File
@@ -31,7 +31,7 @@ jobs:
deb_path: ${{ steps.set_deb_path.outputs.deb_path }} deb_path: ${{ steps.set_deb_path.outputs.deb_path }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up package structure - name: Set up package structure
run: | run: |