From dfbdc46971a53fd67f45a7a8957aff6be1f3c230 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 8 Oct 2024 21:56:58 +0400 Subject: [PATCH 01/11] fix: rpm binary --- .github/workflows/build-binaries.yml | 59 ++++++++++++++++++++++++++++ backend/package-lock.json | 2 +- frontend/package-lock.json | 58 +++++++++++++-------------- frontend/package.json | 7 +++- 4 files changed, 93 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index dba298a37..25c37025a 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -83,6 +83,59 @@ jobs: dpkg-deb --build infisical-core mv infisical-core.deb ./binary/infisical-core-${{matrix.arch}}.deb + ### RPM + + - name: Set up .rpm package structure + if: matrix.os == 'ubuntu-latest' + run: | + mkdir -p infisical-core-rpm/usr/local/bin + cp ./binary/infisical-core infisical-core-rpm/usr/local/bin/ + chmod +x infisical-core-rpm/usr/local/bin/infisical-core + + # Install RPM build tools + - name: Install RPM build tools + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get update && sudo apt-get install -y rpm + + # Create .spec file for RPM + - name: Create .spec file for RPM + if: matrix.os == 'ubuntu-latest' + run: | + cat < infisical-core.spec + Name: infisical-core + Version: ${{ github.event.inputs.version }} + Release: 1%{?dist} + Summary: Infisical Core standalone executable + License: Proprietary + URL: https://app.infisical.com + + %description + Infisical Core standalone executable (app.infisical.com) + + %install + mkdir -p %{buildroot}/usr/local/bin + cp %{_sourcedir}/infisical-core-rpm/usr/local/bin/infisical-core %{buildroot}/usr/local/bin/ + + %files + /usr/local/bin/infisical-core + + %changelog + * $(date '+%a %b %d %Y') Infisical - ${{ github.event.inputs.version }}-1 + - Initial RPM release + EOF + + # Build .rpm file (Red Hat-based systems only) + - name: Build .rpm package + if: matrix.os == 'ubuntu-latest' + run: | + rpmbuild -bb \ + --define "_topdir $(pwd)/rpmbuild" \ + --define "_sourcedir $(pwd)" \ + --define "_rpmdir $(pwd)/binary" \ + --target ${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }} \ + infisical-core.spec + mv rpmbuild/RPMS/${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}/infisical-core-${{ github.event.inputs.version }}-1.*.${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}.rpm ./binary/infisical-core-${{matrix.arch}}.rpm + - uses: actions/setup-python@v4 with: python-version: "3.x" # Specify the Python version you need @@ -97,6 +150,12 @@ jobs: 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 .rpm file to Cloudsmith (Red Hat-based systems only) + - name: Publish .rpm to Cloudsmith + if: matrix.os == 'ubuntu-latest' + working-directory: ./backend + run: cloudsmith push rpm --republish --no-wait-for-sync --api-key=${{ secrets.CLOUDSMITH_API_KEY }} infisical/infisical-core/any-distro/any-version ./binary/infisical-core-${{ matrix.arch }}.rpm + # Publish .exe file to Cloudsmith (Windows only) - name: Publish to Cloudsmith (Windows) if: matrix.os == 'win' diff --git a/backend/package-lock.json b/backend/package-lock.json index 31521fb7d..847eb2ba6 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -61,7 +61,7 @@ "jwks-rsa": "^3.1.0", "knex": "^3.0.1", "ldapjs": "^3.0.7", - "ldif": "^0.5.1", + "ldif": "0.5.1", "libsodium-wrappers": "^0.7.13", "lodash.isequal": "^4.5.0", "mongodb": "^6.8.1", diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5227088b6..47745b125 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,5 +1,5 @@ { - "name": "relock-npm-lock-v2-SvMQeF", + "name": "frontend", "lockfileVersion": 3, "requires": true, "packages": { @@ -40,7 +40,7 @@ "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.0.7", "@reduxjs/toolkit": "^1.8.3", - "@sindresorhus/slugify": "^2.2.1", + "@sindresorhus/slugify": "1.1.0", "@stripe/react-stripe-js": "^1.16.3", "@stripe/stripe-js": "^1.46.0", "@tanstack/react-query": "^4.23.0", @@ -5943,54 +5943,44 @@ "dev": true }, "node_modules/@sindresorhus/slugify": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", - "integrity": "sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-1.1.0.tgz", + "integrity": "sha512-ujZRbmmizX26yS/HnB3P9QNlNa4+UvHh+rIse3RbOXLp8yl6n1TxB4t7NHggtVgS8QmmOtzXo48kCxZGACpkPw==", + "license": "MIT", "dependencies": { - "@sindresorhus/transliterate": "^1.0.0", - "escape-string-regexp": "^5.0.0" + "@sindresorhus/transliterate": "^0.1.1", + "escape-string-regexp": "^4.0.0" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@sindresorhus/slugify/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@sindresorhus/transliterate": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-1.6.0.tgz", - "integrity": "sha512-doH1gimEu3A46VX6aVxpHTeHrytJAG6HgdxntYnCFiIFHEM/ZGpG8KiZGBChchjQmG0XFIBL552kBTjVcMZXwQ==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-0.1.2.tgz", + "integrity": "sha512-5/kmIOY9FF32nicXH+5yLNTX4NJ4atl7jRgqAJuIn/iyDFXBktOKDxCvyGE/EzmF4ngSUvjXxQUQlQiZ5lfw+w==", + "license": "MIT", "dependencies": { - "escape-string-regexp": "^5.0.0" + "escape-string-regexp": "^2.0.0", + "lodash.deburr": "^4.1.0" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@sindresorhus/transliterate/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/@storybook/addon-actions": { @@ -17278,6 +17268,12 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "node_modules/lodash.deburr": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz", + "integrity": "sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ==", + "license": "MIT" + }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", diff --git a/frontend/package.json b/frontend/package.json index 42467ced4..95ce22841 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,6 +12,11 @@ "storybook": "storybook dev -p 6006 -s ./public", "build-storybook": "storybook build" }, + "overrides": { + "@storybook/nextjs": { + "sharp": "npm:dry-uninstall" + } + }, "dependencies": { "@casl/ability": "^6.5.0", "@casl/react": "^3.1.0", @@ -48,7 +53,7 @@ "@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-tooltip": "^1.0.7", "@reduxjs/toolkit": "^1.8.3", - "@sindresorhus/slugify": "^2.2.1", + "@sindresorhus/slugify": "1.1.0", "@stripe/react-stripe-js": "^1.16.3", "@stripe/stripe-js": "^1.46.0", "@tanstack/react-query": "^4.23.0", From f2a7f164e1a0370a8987213840703405ef73030b Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 8 Oct 2024 21:58:49 +0400 Subject: [PATCH 02/11] Trigger build --- .github/workflows/build-binaries.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 25c37025a..44244d0d3 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,12 +1,9 @@ name: Build Binaries and Deploy on: - workflow_dispatch: - inputs: - version: - description: "Version number" - required: true - type: string + push: + branches: + - daniel/rpm-binary defaults: run: @@ -68,7 +65,7 @@ jobs: run: | cat < infisical-core/DEBIAN/control Package: infisical-core - Version: ${{ github.event.inputs.version }} + Version: 1.1.2 Section: base Priority: optional Architecture: ${{ matrix.arch == 'x64' && 'amd64' || matrix.arch }} @@ -103,7 +100,7 @@ jobs: run: | cat < infisical-core.spec Name: infisical-core - Version: ${{ github.event.inputs.version }} + Version: 1.1.2 Release: 1%{?dist} Summary: Infisical Core standalone executable License: Proprietary @@ -118,10 +115,6 @@ jobs: %files /usr/local/bin/infisical-core - - %changelog - * $(date '+%a %b %d %Y') Infisical - ${{ github.event.inputs.version }}-1 - - Initial RPM release EOF # Build .rpm file (Red Hat-based systems only) @@ -134,7 +127,7 @@ jobs: --define "_rpmdir $(pwd)/binary" \ --target ${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }} \ infisical-core.spec - mv rpmbuild/RPMS/${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}/infisical-core-${{ github.event.inputs.version }}-1.*.${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}.rpm ./binary/infisical-core-${{matrix.arch}}.rpm + mv rpmbuild/RPMS/${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}/infisical-core-1.1.2-1.*.${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}.rpm ./binary/infisical-core-${{matrix.arch}}.rpm - uses: actions/setup-python@v4 with: @@ -160,4 +153,4 @@ jobs: - 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 }} + run: cloudsmith push raw infisical/infisical-core ./binary/infisical-core-${{ matrix.os }}-${{ matrix.arch }}.exe --republish --no-wait-for-sync --version 1.1.2 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From 63cc4e347dc5f9d5349e5e50cad5512e3e84baee Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 8 Oct 2024 22:17:59 +0400 Subject: [PATCH 03/11] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 44244d0d3..c73c1e19e 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -83,7 +83,7 @@ jobs: ### RPM - name: Set up .rpm package structure - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'linux' run: | mkdir -p infisical-core-rpm/usr/local/bin cp ./binary/infisical-core infisical-core-rpm/usr/local/bin/ @@ -96,7 +96,7 @@ jobs: # Create .spec file for RPM - name: Create .spec file for RPM - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'linux' run: | cat < infisical-core.spec Name: infisical-core @@ -119,7 +119,7 @@ jobs: # Build .rpm file (Red Hat-based systems only) - name: Build .rpm package - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'linux' run: | rpmbuild -bb \ --define "_topdir $(pwd)/rpmbuild" \ @@ -145,7 +145,7 @@ jobs: # Publish .rpm file to Cloudsmith (Red Hat-based systems only) - name: Publish .rpm to Cloudsmith - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'linux' working-directory: ./backend run: cloudsmith push rpm --republish --no-wait-for-sync --api-key=${{ secrets.CLOUDSMITH_API_KEY }} infisical/infisical-core/any-distro/any-version ./binary/infisical-core-${{ matrix.arch }}.rpm From 246020729e34b651ebc5d08726925583922ba90d Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 8 Oct 2024 22:18:15 +0400 Subject: [PATCH 04/11] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index c73c1e19e..392057f4f 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -91,7 +91,7 @@ jobs: # Install RPM build tools - name: Install RPM build tools - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'linux' run: sudo apt-get update && sudo apt-get install -y rpm # Create .spec file for RPM From f6c65584bf8c3b09763023fd71046bff1d846851 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 8 Oct 2024 22:40:33 +0400 Subject: [PATCH 05/11] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 34 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 392057f4f..192f939ba 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -82,19 +82,12 @@ jobs: ### RPM - - name: Set up .rpm package structure - if: matrix.os == 'linux' - run: | - mkdir -p infisical-core-rpm/usr/local/bin - cp ./binary/infisical-core infisical-core-rpm/usr/local/bin/ - chmod +x infisical-core-rpm/usr/local/bin/infisical-core - # Install RPM build tools - name: Install RPM build tools if: matrix.os == 'linux' run: sudo apt-get update && sudo apt-get install -y rpm - # Create .spec file for RPM + # Create .spec file for RPM - name: Create .spec file for RPM if: matrix.os == 'linux' run: | @@ -117,17 +110,36 @@ jobs: /usr/local/bin/infisical-core EOF - # Build .rpm file (Red Hat-based systems only) + # Build .rpm file (Red Hat-based systems only) - name: Build .rpm package if: matrix.os == 'linux' run: | - rpmbuild -bb \ + # Debug: Print current directory contents + echo "Current directory contents:" + ls -R + + # Run rpmbuild with verbose output + rpmbuild -vv -bb \ --define "_topdir $(pwd)/rpmbuild" \ --define "_sourcedir $(pwd)" \ --define "_rpmdir $(pwd)/binary" \ --target ${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }} \ infisical-core.spec - mv rpmbuild/RPMS/${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}/infisical-core-1.1.2-1.*.${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}.rpm ./binary/infisical-core-${{matrix.arch}}.rpm + + # Debug: Print rpmbuild directory contents + echo "rpmbuild directory contents:" + ls -R rpmbuild + + # Try to find the RPM file + find rpmbuild -name "*.rpm" + + # Move the RPM file if found + if [ -n "$(find rpmbuild -name '*.rpm')" ]; then + mv $(find rpmbuild -name '*.rpm') ./binary/infisical-core-${{matrix.arch}}.rpm + else + echo "RPM file not found!" + exit 1 + fi - uses: actions/setup-python@v4 with: From ff815b5f4217883e962fa353731ab4a19b283479 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 8 Oct 2024 23:38:20 +0400 Subject: [PATCH 06/11] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 192f939ba..64b9bd204 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -82,6 +82,14 @@ jobs: ### RPM + # Set up .rpm package structure + - name: Set up .rpm package structure + if: matrix.os == 'linux' + run: | + mkdir -p infisical-core-rpm/usr/local/bin + cp ./binary/infisical-core infisical-core-rpm/usr/local/bin/ + chmod +x infisical-core-rpm/usr/local/bin/infisical-core + # Install RPM build tools - name: Install RPM build tools if: matrix.os == 'linux' @@ -108,9 +116,17 @@ jobs: %files /usr/local/bin/infisical-core + + %pre + + %post + + %preun + + %postun EOF - # Build .rpm file (Red Hat-based systems only) + # Build .rpm file - name: Build .rpm package if: matrix.os == 'linux' run: | @@ -118,11 +134,17 @@ jobs: echo "Current directory contents:" ls -R + # Create necessary directories + mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + + # Copy the binary to SOURCES + cp -R infisical-core-rpm rpmbuild/SOURCES/ + # Run rpmbuild with verbose output rpmbuild -vv -bb \ --define "_topdir $(pwd)/rpmbuild" \ - --define "_sourcedir $(pwd)" \ - --define "_rpmdir $(pwd)/binary" \ + --define "_sourcedir $(pwd)/rpmbuild/SOURCES" \ + --define "_rpmdir $(pwd)/rpmbuild/RPMS" \ --target ${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }} \ infisical-core.spec From c8d40c6905564b8766e57951ec7484cdfc0938b2 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Wed, 9 Oct 2024 00:17:48 +0400 Subject: [PATCH 07/11] fix for corrupt data --- .github/workflows/build-binaries.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 64b9bd204..d93f21a1a 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -112,7 +112,7 @@ jobs: %install mkdir -p %{buildroot}/usr/local/bin - cp %{_sourcedir}/infisical-core-rpm/usr/local/bin/infisical-core %{buildroot}/usr/local/bin/ + cp %{_sourcedir}/infisical-core %{buildroot}/usr/local/bin/ %files /usr/local/bin/infisical-core @@ -132,13 +132,17 @@ jobs: run: | # Debug: Print current directory contents echo "Current directory contents:" - ls -R + ls -la + + # Debug: Print binary file size + echo "Binary file size:" + ls -lh ./binary/infisical-core # Create necessary directories mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} - # Copy the binary to SOURCES - cp -R infisical-core-rpm rpmbuild/SOURCES/ + # Copy the binary directly to SOURCES + cp ./binary/infisical-core rpmbuild/SOURCES/ # Run rpmbuild with verbose output rpmbuild -vv -bb \ @@ -158,6 +162,9 @@ jobs: # Move the RPM file if found if [ -n "$(find rpmbuild -name '*.rpm')" ]; then mv $(find rpmbuild -name '*.rpm') ./binary/infisical-core-${{matrix.arch}}.rpm + # Debug: Print RPM file size + echo "RPM file size:" + ls -lh ./binary/infisical-core-${{matrix.arch}}.rpm else echo "RPM file not found!" exit 1 From 049c77c9023900ffae3cf3e1cf6b7fa6c96bb00a Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Wed, 9 Oct 2024 00:50:32 +0400 Subject: [PATCH 08/11] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 46 +++------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index d93f21a1a..05f9fc37e 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -51,35 +51,6 @@ jobs: pkg --no-bytecode --public-packages "*" --public --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-core . fi - # Set up .deb package structure (Debian/Ubuntu only) - - name: Set up .deb package structure - if: matrix.os == 'linux' - run: | - mkdir -p infisical-core/DEBIAN - mkdir -p infisical-core/usr/local/bin - cp ./binary/infisical-core infisical-core/usr/local/bin/ - chmod +x infisical-core/usr/local/bin/infisical-core - - - name: Create control file - if: matrix.os == 'linux' - run: | - cat < infisical-core/DEBIAN/control - Package: infisical-core - Version: 1.1.2 - Section: base - Priority: optional - Architecture: ${{ matrix.arch == 'x64' && 'amd64' || matrix.arch }} - Maintainer: Infisical - Description: Infisical Core standalone executable (app.infisical.com) - EOF - - # Build .deb file (Debian/Ubunutu only) - - name: Build .deb package - if: matrix.os == 'linux' - run: | - dpkg-deb --build infisical-core - mv infisical-core.deb ./binary/infisical-core-${{matrix.arch}}.deb - ### RPM # Set up .rpm package structure @@ -100,6 +71,11 @@ jobs: if: matrix.os == 'linux' run: | cat < infisical-core.spec + + %global _enable_debug_package 0 + %global debug_package %{nil} + %global __os_install_post /usr/lib/rpm/brp-compress %{nil} + Name: infisical-core Version: 1.1.2 Release: 1%{?dist} @@ -178,20 +154,8 @@ jobs: python -m pip install --upgrade pip pip install --upgrade cloudsmith-cli - # 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 .rpm file to Cloudsmith (Red Hat-based systems only) - name: Publish .rpm to Cloudsmith if: matrix.os == 'linux' working-directory: ./backend run: cloudsmith push rpm --republish --no-wait-for-sync --api-key=${{ secrets.CLOUDSMITH_API_KEY }} infisical/infisical-core/any-distro/any-version ./binary/infisical-core-${{ matrix.arch }}.rpm - - # 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 1.1.2 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From f8759b98018e14553097dbfe2d0cc653ee975596 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Wed, 9 Oct 2024 01:14:24 +0400 Subject: [PATCH 09/11] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 05f9fc37e..6b1475989 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -51,6 +51,35 @@ jobs: pkg --no-bytecode --public-packages "*" --public --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-core . fi + # Set up .deb package structure (Debian/Ubuntu only) + - name: Set up .deb package structure + if: matrix.os == 'linux' + run: | + mkdir -p infisical-core/DEBIAN + mkdir -p infisical-core/usr/local/bin + cp ./binary/infisical-core infisical-core/usr/local/bin/ + chmod +x infisical-core/usr/local/bin/infisical-core + + - name: Create control file + if: matrix.os == 'linux' + run: | + cat < infisical-core/DEBIAN/control + Package: infisical-core + Version: 1.1.2 + Section: base + Priority: optional + Architecture: ${{ matrix.arch == 'x64' && 'amd64' || matrix.arch }} + Maintainer: Infisical + Description: Infisical Core standalone executable (app.infisical.com) + EOF + + # Build .deb file (Debian/Ubunutu only) + - name: Build .deb package + if: matrix.os == 'linux' + run: | + dpkg-deb --build infisical-core + mv infisical-core.deb ./binary/infisical-core-${{matrix.arch}}.deb + ### RPM # Set up .rpm package structure @@ -154,8 +183,20 @@ jobs: python -m pip install --upgrade pip pip install --upgrade cloudsmith-cli + # 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 .rpm file to Cloudsmith (Red Hat-based systems only) - name: Publish .rpm to Cloudsmith if: matrix.os == 'linux' working-directory: ./backend run: cloudsmith push rpm --republish --no-wait-for-sync --api-key=${{ secrets.CLOUDSMITH_API_KEY }} infisical/infisical-core/any-distro/any-version ./binary/infisical-core-${{ matrix.arch }}.rpm + + # 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 1.1.2 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} From 6dad24ffde716452a0abcd77b90478bb6dc21fde Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Wed, 9 Oct 2024 01:39:53 +0400 Subject: [PATCH 10/11] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 6b1475989..6e907af5c 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,10 +1,12 @@ name: Build Binaries and Deploy on: - push: - branches: - - daniel/rpm-binary - + workflow_dispatch: + inputs: + version: + description: "Version number" + required: true + type: string defaults: run: working-directory: ./backend @@ -65,7 +67,7 @@ jobs: run: | cat < infisical-core/DEBIAN/control Package: infisical-core - Version: 1.1.2 + Version: ${{ github.event.inputs.version }} Section: base Priority: optional Architecture: ${{ matrix.arch == 'x64' && 'amd64' || matrix.arch }} @@ -106,7 +108,7 @@ jobs: %global __os_install_post /usr/lib/rpm/brp-compress %{nil} Name: infisical-core - Version: 1.1.2 + Version: ${{ github.event.inputs.version }} Release: 1%{?dist} Summary: Infisical Core standalone executable License: Proprietary @@ -199,4 +201,4 @@ jobs: - 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 1.1.2 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + 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 }} From b46bbea0c5432cea7eabe1e87c5ee7807f51b022 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Wed, 9 Oct 2024 01:48:23 +0400 Subject: [PATCH 11/11] fix: removed debug data & re-add compression --- .github/workflows/build-binaries.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 6e907af5c..552eb56e4 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -48,9 +48,9 @@ jobs: - name: Package into node binary run: | if [ "${{ matrix.os }}" != "linux" ]; then - pkg --no-bytecode --public-packages "*" --public --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-core-${{ matrix.os }}-${{ matrix.arch }} . + pkg --no-bytecode --public-packages "*" --public --compress GZip --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-core-${{ matrix.os }}-${{ matrix.arch }} . else - pkg --no-bytecode --public-packages "*" --public --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-core . + pkg --no-bytecode --public-packages "*" --public --compress GZip --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-core . fi # Set up .deb package structure (Debian/Ubuntu only) @@ -137,14 +137,6 @@ jobs: - name: Build .rpm package if: matrix.os == 'linux' run: | - # Debug: Print current directory contents - echo "Current directory contents:" - ls -la - - # Debug: Print binary file size - echo "Binary file size:" - ls -lh ./binary/infisical-core - # Create necessary directories mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} @@ -159,19 +151,12 @@ jobs: --target ${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }} \ infisical-core.spec - # Debug: Print rpmbuild directory contents - echo "rpmbuild directory contents:" - ls -R rpmbuild - # Try to find the RPM file find rpmbuild -name "*.rpm" # Move the RPM file if found if [ -n "$(find rpmbuild -name '*.rpm')" ]; then mv $(find rpmbuild -name '*.rpm') ./binary/infisical-core-${{matrix.arch}}.rpm - # Debug: Print RPM file size - echo "RPM file size:" - ls -lh ./binary/infisical-core-${{matrix.arch}}.rpm else echo "RPM file not found!" exit 1