From 54e5166bb6738e15616f62c4698d1985e00216e4 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Wed, 3 Jul 2024 01:23:55 +0200 Subject: [PATCH] Update build-binaries.yml --- .github/workflows/build-binaries.yml | 46 +++++++++++++--------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index be87f1d15..6e9f605b0 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,17 +1,15 @@ name: Build Binaries on: - workflow_dispatch: - - pull_request: - branches: - - daniel/infisical-binary + # pull_request: + # branches: + # - daniel/infisical-binary push: - branches: - - daniel/infisical-binary + # branches: + # - daniel/infisical-binary - # run for standalone releases + # run for standalone releases tags: - "infisical-standalone/v*.*.*" @@ -36,20 +34,20 @@ jobs: - 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: 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: Version extration test + run: | + echo "The extracted version is ${{ steps.extract_version.outputs.version }}" - name: Set up Node.js uses: actions/setup-node@v3 @@ -72,7 +70,7 @@ jobs: working-directory: ./backend - 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 --compress Brotli --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} . working-directory: ./backend - name: List files @@ -84,9 +82,9 @@ jobs: - name: Publish to Cloudsmith (Linux) working-directory: ./backend if: matrix.os == 'linux' - run: cloudsmith push raw infisical/infisical-standalone ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} --republish --no-wait-for-sync --version 0.0.3 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + run: cloudsmith push raw infisical/infisical-standalone ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} --republish --no-wait-for-sync --version ${{ steps.extract_version.outputs.version }} --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 0.0.3 --api-key ${{ secrets.CLOUDSMITH_API_KEY }} + run: cloudsmith push raw infisical/infisical-standalone ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }}.exe --republish --no-wait-for-sync --version ${{ steps.extract_version.outputs.version }} --api-key ${{ secrets.CLOUDSMITH_API_KEY }}