mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-10 07:58:15 -05:00
Attempt .deb package
This commit is contained in:
33
.github/workflows/build-binaries.yml
vendored
33
.github/workflows/build-binaries.yml
vendored
@@ -22,8 +22,10 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x64, arm64]
|
||||
os: [linux, alphine, win]
|
||||
# arch: [x64, arm64]
|
||||
# os: [linux, alphine, win]
|
||||
arch: [x64]
|
||||
os: [linux]
|
||||
include:
|
||||
- os: linux
|
||||
target: node18-linux
|
||||
@@ -76,20 +78,29 @@ jobs:
|
||||
- name: List files
|
||||
run: ls -la ./binary
|
||||
|
||||
- name: Create .deb package
|
||||
id: build-deb
|
||||
if: matrix.os == 'linux'
|
||||
uses: ./.github/workflows/build-deb.yml
|
||||
with:
|
||||
executable_path: ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }}
|
||||
arch: ${{ matrix.arch }}
|
||||
version: "3.0.0"
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
- run: pip install --upgrade cloudsmith-cli
|
||||
|
||||
- name: Publish to Cloudsmith (Linux)
|
||||
working-directory: ./backend
|
||||
if: matrix.os == 'linux'
|
||||
run: cloudsmith push deb infisical/infisical-standalone ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} --republish --no-wait-for-sync --version 3.0.0 --api-key ${{ secrets.CLOUDSMITH_API_KEY }}
|
||||
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 }}
|
||||
|
||||
- name: Publish to Cloudsmith (Windows)
|
||||
working-directory: ./backend
|
||||
if: matrix.os == 'win'
|
||||
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 }}
|
||||
# - name: Publish to Cloudsmith (Windows)
|
||||
# working-directory: ./backend
|
||||
# if: matrix.os == 'win'
|
||||
# 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 }}
|
||||
|
||||
- name: Publish to Cloudsmith (Alphine)
|
||||
working-directory: ./backend
|
||||
if: matrix.os == 'alphine'
|
||||
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 }}
|
||||
# - name: Publish to Cloudsmith (Alphine)
|
||||
# working-directory: ./backend
|
||||
# if: matrix.os == 'alphine'
|
||||
# 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 }}
|
||||
|
||||
85
.github/workflows/build-deb.yml
vendored
Normal file
85
.github/workflows/build-deb.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: Build Debian Package
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
os:
|
||||
required: true
|
||||
type: string
|
||||
arch:
|
||||
required: true
|
||||
type: string
|
||||
version:
|
||||
required: true
|
||||
type: string
|
||||
executable_path:
|
||||
required: true
|
||||
type: string
|
||||
outputs:
|
||||
deb_path:
|
||||
description: "Path to the generated .deb file"
|
||||
value: ${{ jobs.build.outputs.deb_path }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./backend
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
deb_path: ${{ steps.set_deb_path.outputs.deb_path }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up package structure
|
||||
run: |
|
||||
mkdir -p infisical-standalone/DEBIAN
|
||||
mkdir -p infisical-standalone/usr/local/bin
|
||||
|
||||
- name: Copy executable
|
||||
run: |
|
||||
cp ${{inputs.executable_path}} infisical-standalone/usr/local/bin/
|
||||
chmod +x infisical-standalone/usr/local/bin/infisical-${{ inputs.os }}-${{ inputs.arch }}
|
||||
|
||||
- name: Create control file (x64)
|
||||
if: inputs.arch == 'x64'
|
||||
run: |
|
||||
cat <<EOF > infisical-standalone/DEBIAN/control
|
||||
Package: infisical-standalone
|
||||
Version: ${{ inputs.version }}
|
||||
Section: base
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Infisical <daniel@infisical.com>
|
||||
Description: Infisical standalone executable (app.infisical.com)
|
||||
EOF
|
||||
|
||||
- name: Create control file (other architectures)
|
||||
if: inputs.arch != 'x64'
|
||||
run: |
|
||||
cat <<EOF > infisical-standalone/DEBIAN/control
|
||||
Package: infisical-standalone-${{ inputs.arch }}
|
||||
Version: ${{ inputs.version }}
|
||||
Section: base
|
||||
Priority: optional
|
||||
Architecture: ${{ inputs.arch }}
|
||||
Maintainer: Infisical <daniel@infisical.com>
|
||||
Description: Infisical standalone executable (app.infisical.com)
|
||||
EOF
|
||||
|
||||
- name: Set permissions
|
||||
run: |
|
||||
chmod 755 infisical-standalone/DEBIAN
|
||||
chmod 644 infisical-standalone/DEBIAN/control
|
||||
|
||||
- name: Build .deb package
|
||||
run: dpkg-deb --build infisical-standalone
|
||||
|
||||
- name: Rename package
|
||||
run: mv infisical-standalone.deb infisical-linux-${{ inputs.arch }}.deb
|
||||
|
||||
- name: Set deb path output
|
||||
id: set_deb_path
|
||||
run: echo "deb_path=$(pwd)/infisical-linux-${{ inputs.arch }}.deb" >> $GITHUB_OUTPUT
|
||||
Reference in New Issue
Block a user