-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37d51aa
commit 32ecec9
Showing
2 changed files
with
107 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |