-
Notifications
You must be signed in to change notification settings - Fork 866
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
9d9a585
commit 7aeb38b
Showing
2 changed files
with
29 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
name: Build Binaries | ||
name: Build Binaries and Deploy | ||
|
||
on: | ||
# pull_request: | ||
# branches: | ||
# - daniel/infisical-binary | ||
|
||
push: | ||
branches: | ||
- daniel/infisical-binary | ||
|
||
# run for standalone releases | ||
tags: | ||
- "infisical-standalone/v*.*.*" | ||
|
||
|
@@ -18,38 +12,29 @@ defaults: | |
working-directory: ./backend | ||
|
||
jobs: | ||
build-and-release: | ||
build-and-deploy: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
# arch: [x64, arm64] | ||
# os: [linux, alphine, win] | ||
arch: [x64] | ||
os: [linux] | ||
include: | ||
- os: linux | ||
target: node18-linux | ||
# - os: win | ||
# target: node18-win | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# - name: Extract version from tag | ||
# id: extract_version | ||
# run: | | ||
# # Get the tag name | ||
# TAG_NAME=$(git describe --tags) | ||
# # Extract the version part | ||
# VERSION=${TAG_NAME#infisical-standalone/v} | ||
# echo "Extracted version is $VERSION" | ||
# # Set the version as an output | ||
# echo "::set-output name=version::$VERSION" | ||
|
||
# - name: Version extration test | ||
# run: | | ||
# echo "The extracted version is ${{ steps.extract_version.outputs.version }}" | ||
- name: Extract version from tag | ||
id: extract_version | ||
run: | | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF#refs/tags/infisical-standalone/v} | ||
else | ||
VERSION=$(git rev-parse --short HEAD) | ||
fi | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
|
@@ -61,46 +46,35 @@ jobs: | |
|
||
- 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 # --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 }} . | ||
working-directory: ./backend | ||
|
||
- name: List files | ||
run: ls -la ./binary | ||
|
||
- name: Create .deb package | ||
id: build-deb | ||
- name: Build .deb package | ||
if: matrix.os == 'linux' | ||
uses: ./.github/workflows/build-deb.yml | ||
with: | ||
executable_path: ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} | ||
os: ${{ matrix.os }} | ||
arch: ${{ matrix.arch }} | ||
version: "3.0.0" | ||
|
||
- uses: actions/setup-python@v4 | ||
- run: pip install --upgrade cloudsmith-cli | ||
version: ${{ steps.extract_version.outputs.version }} | ||
executable_path: ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} | ||
|
||
- name: Publish to Cloudsmith (Linux) | ||
working-directory: ./backend | ||
- name: Upload to Cloudsmith | ||
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 }} | ||
|
||
# - 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 }} | ||
uses: cloudsmith-io/[email protected] | ||
with: | ||
api-key: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
command: "push" | ||
format: "deb" | ||
owner: "your-cloudsmith-org" | ||
repo: "your-cloudsmith-repo" | ||
distro: "any-distro" | ||
release: "any-release" | ||
republish: "true" | ||
file: ${{ steps.build-deb.outputs.deb_path }} |
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