From 42dcc81767b3fbd7b083d26d381735436248799f Mon Sep 17 00:00:00 2001 From: fsantiago Date: Mon, 5 May 2025 18:36:17 +0200 Subject: [PATCH 01/14] =?UTF-8?q?:wrench:=20=20=F0=9F=94=A7=20add=20initia?= =?UTF-8?q?l=20pipeline=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 29 ++++++++++++++ .github/workflows/build-bundles.yml | 60 +++++++++++++++++++++++++++++ Dockerfile.ci | 16 ++++++++ docker/devenv/Dockerfile | 13 +++++-- manage.sh | 20 ++++++---- 5 files changed, 127 insertions(+), 11 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/build-bundles.yml create mode 100644 Dockerfile.ci diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..5ef51b3086 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,29 @@ +# Ignorar Git y configuración +.git +.gitignore +.gitattributes + +# Ignorar cachés de dependencias +node_modules +bower_components +tmp +.cache + +# Ignorar archivos locales de desarrollo +.DS_Store +*.swp +*.swo +*.log + +# Ignorar artefactos de builds +bundles/ +frontend/target/ +backend/target/ +exporter/target/ +docs/_dist/ + +# Ignorar configuración de CI no necesaria +.github/ +.circleci/ +.vscode/ +.idea/ diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml new file mode 100644 index 0000000000..054902a565 --- /dev/null +++ b/.github/workflows/build-bundles.yml @@ -0,0 +1,60 @@ +name: Build and Upload Penpot Bundles + +on: + workflow_dispatch: + push: + branches: + - github-actions-bundle-build + +jobs: + build-bundles: + name: Build frontend, backend, exporter and upload bundles + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Penpot CI Builder Image + run: | + docker build \ + --build-arg EXTERNAL_UID=1000 \ + --build-arg EXTERNAL_GID=1000 \ + -t penpotapp/penpot-ci-builder:latest \ + -f docker/devenv/Dockerfile . + + - name: Run manage.sh build-bundle from host + run: ./manage.sh build-bundle + + - name: Create global README and package all bundles + run: | + echo "# Penpot Bundles" > bundles/README.md + echo "" >> bundles/README.md + echo "This package contains the automatically built Penpot artifacts (frontend, backend, and exporter) from the official repository." >> bundles/README.md + echo "" >> bundles/README.md + echo "## Contents" >> bundles/README.md + echo "" >> bundles/README.md + echo "- frontend/: Compiled frontend files of Penpot." >> bundles/README.md + echo "- backend/: Backend build artifacts of Penpot." >> bundles/README.md + echo "- exporter/: Module responsible for exporting resources from Penpot." >> bundles/README.md + echo "- README.md: This file." >> bundles/README.md + echo "" >> bundles/README.md + echo "## Usage" >> bundles/README.md + echo "" >> bundles/README.md + echo "1. Unzip the \"penpot-all-bundles.zip\" archive in your target environment." >> bundles/README.md + echo "2. Explore each subdirectory and follow the appropriate deployment steps for frontend, backend, and exporter based on your infrastructure." >> bundles/README.md + echo "3. You can use servers like NGINX to serve the frontend and Dockerized or custom environments to run backend/exporter services." >> bundles/README.md + + cd bundles + mkdir all-in-one + cp -r ../frontend ../backend ../exporter README.md all-in-one/ + zip -r penpot-all-bundles.zip all-in-one + + - name: Upload all-in-one bundle + uses: actions/upload-artifact@v4 + with: + name: penpot-all-bundles + path: bundles/penpot-all-bundles.zip diff --git a/Dockerfile.ci b/Dockerfile.ci new file mode 100644 index 0000000000..24b6664a25 --- /dev/null +++ b/Dockerfile.ci @@ -0,0 +1,16 @@ +# Dockerfile para Penpot CI Builder + +FROM penpotapp/devenv:latest + +USER root + +RUN mkdir -p /home/penpot/.cache/node/corepack/v1 && \ + chown -R 1000:1000 /home/penpot + +USER penpot +ENV HOME=/home/penpot +WORKDIR /home/penpot/penpot + +COPY . . + +RUN corepack enable && corepack prepare yarn@stable --activate diff --git a/docker/devenv/Dockerfile b/docker/devenv/Dockerfile index d9105fbe49..e5b27252c0 100644 --- a/docker/devenv/Dockerfile +++ b/docker/devenv/Dockerfile @@ -45,11 +45,18 @@ RUN set -ex; \ locale-gen; \ rm -rf /var/lib/apt/lists/*; +ARG EXTERNAL_UID=1000 +ARG EXTERNAL_GID=1000 + RUN set -ex; \ - usermod -l penpot -d /home/penpot -G users -s /bin/bash ubuntu; \ - passwd penpot -d; \ + groupmod -g $EXTERNAL_GID ubuntu || true; \ + usermod -l penpot -d /home/penpot -u $EXTERNAL_UID -g $EXTERNAL_GID -m ubuntu || true; \ + usermod -s /bin/bash penpot; \ + mkdir -p /home/penpot; \ + chown -R $EXTERNAL_UID:$EXTERNAL_GID /home/penpot; \ + passwd -d penpot || true; \ echo "penpot ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers - + RUN set -ex; \ apt-get -qq update; \ apt-get -qqy install --no-install-recommends \ diff --git a/manage.sh b/manage.sh index 5af31dd055..9bfe2f8acd 100755 --- a/manage.sh +++ b/manage.sh @@ -7,6 +7,9 @@ export DEVENV_PNAME="penpotdev"; export CURRENT_USER_ID=$(id -u); export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD); +# Safe directory para evitar errores de ownership con Git +git config --global --add safe.directory /home/penpot/penpot || true + # Set default java options export JAVA_OPTS=${JAVA_OPTS:-"-Xmx1000m -Xms50m"}; @@ -111,14 +114,15 @@ function build { pull-devenv-if-not-exists; docker volume create ${DEVENV_PNAME}_user_data; docker run -t --rm \ - --mount source=${DEVENV_PNAME}_user_data,type=volume,target=/home/penpot/ \ - --mount source=`pwd`,type=bind,target=/home/penpot/penpot \ - -e EXTERNAL_UID=$CURRENT_USER_ID \ - -e BUILD_STORYBOOK=$BUILD_STORYBOOK \ - -e SHADOWCLJS_EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS \ - -e JAVA_OPTS="$JAVA_OPTS" \ - -w /home/penpot/penpot/$1 \ - $DEVENV_IMGNAME:latest sudo -EH -u penpot ./scripts/build $version + --mount source=${DEVENV_PNAME}_user_data,type=volume,target=/home/penpot/ \ + --mount source=`pwd`,type=bind,target=/home/penpot/penpot \ + -e EXTERNAL_UID=$CURRENT_USER_ID \ + -e BUILD_STORYBOOK=$BUILD_STORYBOOK \ + -e SHADOWCLJS_EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS \ + -e JAVA_OPTS="$JAVA_OPTS" \ + -w /home/penpot/penpot/$1 \ + $DEVENV_IMGNAME:latest sh -c "chown -R penpot:ubuntu /home/penpot && sudo -EH -u penpot ./scripts/build $version" + echo ">> build end: $1" } From 5b777921a669cbda5498754a997b9f3508ef8272 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Mon, 5 May 2025 18:46:42 +0200 Subject: [PATCH 02/14] =?UTF-8?q?:memo:=20=F0=9F=93=9D=20update=20referenc?= =?UTF-8?q?e=20to=20PENPOT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index 054902a565..cf353d93e8 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -57,4 +57,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: penpot-all-bundles - path: bundles/penpot-all-bundles.zip + path: bundles/penpot-bundles.zip From 0fb41f54b0acb6de88c196062cbe965a39bd571d Mon Sep 17 00:00:00 2001 From: fsantiago Date: Mon, 5 May 2025 18:55:15 +0200 Subject: [PATCH 03/14] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=E2=9C=85=20add?= =?UTF-8?q?=20initial=20tests=20for=20zip=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index cf353d93e8..efe2c505ed 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -24,7 +24,8 @@ jobs: --build-arg EXTERNAL_UID=1000 \ --build-arg EXTERNAL_GID=1000 \ -t penpotapp/penpot-ci-builder:latest \ - -f docker/devenv/Dockerfile . + -f Dockerfile \ + docker/devenv - name: Run manage.sh build-bundle from host run: ./manage.sh build-bundle From 47552830b1b1585fe84b1c5cf37f9b0e72a214da Mon Sep 17 00:00:00 2001 From: fsantiago Date: Mon, 5 May 2025 18:57:39 +0200 Subject: [PATCH 04/14] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=F0=9F=A7=AA=20a?= =?UTF-8?q?dd=20temporary=20integration=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index efe2c505ed..4764a19675 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -24,7 +24,7 @@ jobs: --build-arg EXTERNAL_UID=1000 \ --build-arg EXTERNAL_GID=1000 \ -t penpotapp/penpot-ci-builder:latest \ - -f Dockerfile \ + -f docker/devenv/Dockerfile \ docker/devenv - name: Run manage.sh build-bundle from host From 3be750410e1de13a1f61585bcca458801c1ffb20 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Mon, 5 May 2025 19:11:07 +0200 Subject: [PATCH 05/14] =?UTF-8?q?:wrench:=20=F0=9F=94=A7=20update=20file?= =?UTF-8?q?=20paths=20in=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index 4764a19675..168943c918 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -58,4 +58,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: penpot-all-bundles - path: bundles/penpot-bundles.zip + path: bundles/penpot-all-bundles.zip From 10d021b15e23adb8250a048c0623672da179cda1 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 12:16:30 +0200 Subject: [PATCH 06/14] =?UTF-8?q?:sparkles:=20=E2=9C=A8=20implement=20zip?= =?UTF-8?q?=20type=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 100 ++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index 168943c918..8d5224389c 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -2,9 +2,18 @@ name: Build and Upload Penpot Bundles on: workflow_dispatch: - push: - branches: - - github-actions-bundle-build + inputs: + zip_mode: + description: 'Bundle packaging mode' + required: false + default: 'individual' + type: choice + options: + - individual + - all + +env: + ZIP_MODE: ${{ github.event.inputs.zip_mode }} jobs: build-bundles: @@ -24,38 +33,75 @@ jobs: --build-arg EXTERNAL_UID=1000 \ --build-arg EXTERNAL_GID=1000 \ -t penpotapp/penpot-ci-builder:latest \ - -f docker/devenv/Dockerfile \ - docker/devenv + -f docker/devenv/Dockerfile . - name: Run manage.sh build-bundle from host run: ./manage.sh build-bundle - - name: Create global README and package all bundles + - name: Create README and zip bundles run: | - echo "# Penpot Bundles" > bundles/README.md - echo "" >> bundles/README.md - echo "This package contains the automatically built Penpot artifacts (frontend, backend, and exporter) from the official repository." >> bundles/README.md - echo "" >> bundles/README.md - echo "## Contents" >> bundles/README.md - echo "" >> bundles/README.md - echo "- frontend/: Compiled frontend files of Penpot." >> bundles/README.md - echo "- backend/: Backend build artifacts of Penpot." >> bundles/README.md - echo "- exporter/: Module responsible for exporting resources from Penpot." >> bundles/README.md - echo "- README.md: This file." >> bundles/README.md - echo "" >> bundles/README.md - echo "## Usage" >> bundles/README.md - echo "" >> bundles/README.md - echo "1. Unzip the \"penpot-all-bundles.zip\" archive in your target environment." >> bundles/README.md - echo "2. Explore each subdirectory and follow the appropriate deployment steps for frontend, backend, and exporter based on your infrastructure." >> bundles/README.md - echo "3. You can use servers like NGINX to serve the frontend and Dockerized or custom environments to run backend/exporter services." >> bundles/README.md + echo "\u2728 Generating bundle documentation and packaging..." - cd bundles - mkdir all-in-one - cp -r ../frontend ../backend ../exporter README.md all-in-one/ - zip -r penpot-all-bundles.zip all-in-one + # Frontend README + echo "# Penpot Frontend Bundle" > frontend/README.md + echo "This bundle contains the compiled frontend of Penpot." >> frontend/README.md - - name: Upload all-in-one bundle + # Backend README + echo "# Penpot Backend Bundle" > backend/README.md + echo "This bundle contains the backend artifacts of Penpot." >> backend/README.md + + # Exporter README + echo "# Penpot Exporter Bundle" > exporter/README.md + echo "This bundle contains the export module artifacts of Penpot." >> exporter/README.md + + if [[ \"${ZIP_MODE}\" == \"all\" ]]; then + echo "Generating penpot-all-bundles.zip" + mkdir -p bundles/all-in-one/frontend bundles/all-in-one/backend bundles/all-in-one/exporter + cp -r frontend/* bundles/all-in-one/frontend/ + cp -r backend/* bundles/all-in-one/backend/ + cp -r exporter/* bundles/all-in-one/exporter/ + echo "# Penpot Bundles" > bundles/all-in-one/README.md + echo "" >> bundles/all-in-one/README.md + echo "This package contains all Penpot build artifacts." >> bundles/all-in-one/README.md + echo "" >> bundles/all-in-one/README.md + echo "- frontend/: Contains the compiled frontend." >> bundles/all-in-one/README.md + echo "- backend/: Contains the backend services." >> bundles/all-in-one/README.md + echo "- exporter/: Contains the export tools." >> bundles/all-in-one/README.md + echo "" >> bundles/all-in-one/README.md + echo "To deploy, extract and copy the desired bundle to the corresponding environment." >> bundles/all-in-one/README.md + cd bundles + zip -r penpot-all-bundles.zip all-in-one + else + echo "Generating individual zip files" + zip -r frontend.zip frontend + zip -r backend.zip backend + zip -r exporter.zip exporter + fi + + - name: Upload combined bundle (if exists) + if: env.ZIP_MODE == 'all' uses: actions/upload-artifact@v4 with: name: penpot-all-bundles path: bundles/penpot-all-bundles.zip + + - name: Upload frontend bundle + if: env.ZIP_MODE != 'all' + uses: actions/upload-artifact@v4 + with: + name: frontend-bundle + path: frontend.zip + + - name: Upload backend bundle + if: env.ZIP_MODE != 'all' + uses: actions/upload-artifact@v4 + with: + name: backend-bundle + path: backend.zip + + - name: Upload exporter bundle + if: env.ZIP_MODE != 'all' + uses: actions/upload-artifact@v4 + with: + name: exporter-bundle + path: exporter.zip From d9cdd020e68f422a55e8bc0ab33a5812f698df8c Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 12:24:18 +0200 Subject: [PATCH 07/14] =?UTF-8?q?:recycle:=20=E2=99=BB=EF=B8=8F=20improve?= =?UTF-8?q?=20zip=20type=20definition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index 8d5224389c..d3143e8f39 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -11,7 +11,9 @@ on: options: - individual - all - + push: + branches: + - github-actions-bundle-build env: ZIP_MODE: ${{ github.event.inputs.zip_mode }} From 0032639831fcf109a12b9e13c56b09d60fba9c6f Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 12:27:39 +0200 Subject: [PATCH 08/14] =?UTF-8?q?:bug:=20=F0=9F=90=9B=20correct=20zip=20ty?= =?UTF-8?q?pe=20validation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index d3143e8f39..9bd7acc68e 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -1,3 +1,4 @@ + name: Build and Upload Penpot Bundles on: @@ -11,9 +12,7 @@ on: options: - individual - all - push: - branches: - - github-actions-bundle-build + env: ZIP_MODE: ${{ github.event.inputs.zip_mode }} @@ -36,6 +35,7 @@ jobs: --build-arg EXTERNAL_GID=1000 \ -t penpotapp/penpot-ci-builder:latest \ -f docker/devenv/Dockerfile . + docker/devenv - name: Run manage.sh build-bundle from host run: ./manage.sh build-bundle From 7359b800cecb2c5a2978e27b2d17081d55751ca6 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 12:47:22 +0200 Subject: [PATCH 09/14] =?UTF-8?q?:wrench:=20=F0=9F=A7=B9=20reorganize=20zi?= =?UTF-8?q?p=20type=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index 9bd7acc68e..6e00b18f0b 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -12,7 +12,9 @@ on: options: - individual - all - + push: + branches: + - github-actions-bundle-build env: ZIP_MODE: ${{ github.event.inputs.zip_mode }} From 60f8cfd4924a0efa660493c054f687b298ee8eef Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 12:50:47 +0200 Subject: [PATCH 10/14] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=E2=9C=85=20add?= =?UTF-8?q?=20more=20tests=20for=20zip=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index 6e00b18f0b..e3041df9d3 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -37,7 +37,6 @@ jobs: --build-arg EXTERNAL_GID=1000 \ -t penpotapp/penpot-ci-builder:latest \ -f docker/devenv/Dockerfile . - docker/devenv - name: Run manage.sh build-bundle from host run: ./manage.sh build-bundle From ccd7b3bdceeaca3575dcfe0e6f9a63de62732716 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 12:52:15 +0200 Subject: [PATCH 11/14] =?UTF-8?q?:wrench:=20=F0=9F=A7=B9=20minor=20code=20?= =?UTF-8?q?cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 97 ++++++++--------------------- 1 file changed, 25 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index e3041df9d3..d4e31e6019 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -1,22 +1,12 @@ + name: Build and Upload Penpot Bundles on: workflow_dispatch: - inputs: - zip_mode: - description: 'Bundle packaging mode' - required: false - default: 'individual' - type: choice - options: - - individual - - all push: branches: - github-actions-bundle-build -env: - ZIP_MODE: ${{ github.event.inputs.zip_mode }} jobs: build-bundles: @@ -36,75 +26,38 @@ jobs: --build-arg EXTERNAL_UID=1000 \ --build-arg EXTERNAL_GID=1000 \ -t penpotapp/penpot-ci-builder:latest \ - -f docker/devenv/Dockerfile . + -f docker/devenv/Dockerfile \ + docker/devenv - name: Run manage.sh build-bundle from host run: ./manage.sh build-bundle - - name: Create README and zip bundles + - name: Create global README and package all bundles run: | - echo "\u2728 Generating bundle documentation and packaging..." + echo "# Penpot Bundles" > bundles/README.md + echo "" >> bundles/README.md + echo "This package contains the automatically built Penpot artifacts (frontend, backend, and exporter) from the official repository." >> bundles/README.md + echo "" >> bundles/README.md + echo "## Contents" >> bundles/README.md + echo "" >> bundles/README.md + echo "- frontend/: Compiled frontend files of Penpot." >> bundles/README.md + echo "- backend/: Backend build artifacts of Penpot." >> bundles/README.md + echo "- exporter/: Module responsible for exporting resources from Penpot." >> bundles/README.md + echo "- README.md: This file." >> bundles/README.md + echo "" >> bundles/README.md + echo "## Usage" >> bundles/README.md + echo "" >> bundles/README.md + echo "1. Unzip the \"penpot-all-bundles.zip\" archive in your target environment." >> bundles/README.md + echo "2. Explore each subdirectory and follow the appropriate deployment steps for frontend, backend, and exporter based on your infrastructure." >> bundles/README.md + echo "3. You can use servers like NGINX to serve the frontend and Dockerized or custom environments to run backend/exporter services." >> bundles/README.md - # Frontend README - echo "# Penpot Frontend Bundle" > frontend/README.md - echo "This bundle contains the compiled frontend of Penpot." >> frontend/README.md + cd bundles + mkdir all-in-one + cp -r ../frontend ../backend ../exporter README.md all-in-one/ + zip -r penpot-all-bundles.zip all-in-one - # Backend README - echo "# Penpot Backend Bundle" > backend/README.md - echo "This bundle contains the backend artifacts of Penpot." >> backend/README.md - - # Exporter README - echo "# Penpot Exporter Bundle" > exporter/README.md - echo "This bundle contains the export module artifacts of Penpot." >> exporter/README.md - - if [[ \"${ZIP_MODE}\" == \"all\" ]]; then - echo "Generating penpot-all-bundles.zip" - mkdir -p bundles/all-in-one/frontend bundles/all-in-one/backend bundles/all-in-one/exporter - cp -r frontend/* bundles/all-in-one/frontend/ - cp -r backend/* bundles/all-in-one/backend/ - cp -r exporter/* bundles/all-in-one/exporter/ - echo "# Penpot Bundles" > bundles/all-in-one/README.md - echo "" >> bundles/all-in-one/README.md - echo "This package contains all Penpot build artifacts." >> bundles/all-in-one/README.md - echo "" >> bundles/all-in-one/README.md - echo "- frontend/: Contains the compiled frontend." >> bundles/all-in-one/README.md - echo "- backend/: Contains the backend services." >> bundles/all-in-one/README.md - echo "- exporter/: Contains the export tools." >> bundles/all-in-one/README.md - echo "" >> bundles/all-in-one/README.md - echo "To deploy, extract and copy the desired bundle to the corresponding environment." >> bundles/all-in-one/README.md - cd bundles - zip -r penpot-all-bundles.zip all-in-one - else - echo "Generating individual zip files" - zip -r frontend.zip frontend - zip -r backend.zip backend - zip -r exporter.zip exporter - fi - - - name: Upload combined bundle (if exists) - if: env.ZIP_MODE == 'all' + - name: Upload all-in-one bundle uses: actions/upload-artifact@v4 with: name: penpot-all-bundles path: bundles/penpot-all-bundles.zip - - - name: Upload frontend bundle - if: env.ZIP_MODE != 'all' - uses: actions/upload-artifact@v4 - with: - name: frontend-bundle - path: frontend.zip - - - name: Upload backend bundle - if: env.ZIP_MODE != 'all' - uses: actions/upload-artifact@v4 - with: - name: backend-bundle - path: backend.zip - - - name: Upload exporter bundle - if: env.ZIP_MODE != 'all' - uses: actions/upload-artifact@v4 - with: - name: exporter-bundle - path: exporter.zip From 0fbd9812b37e6d566b2fed4eabd0e171e1ab2717 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 13:37:47 +0200 Subject: [PATCH 12/14] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=F0=9F=A7=AA=20b?= =?UTF-8?q?asic=20execution=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 91 ++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index d4e31e6019..d7bb12ecbd 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -1,12 +1,19 @@ - - name: Build and Upload Penpot Bundles on: workflow_dispatch: - push: - branches: - - github-actions-bundle-build + inputs: + zip_mode: + description: 'Bundle packaging mode' + required: false + default: 'individual' + type: choice + options: + - individual + - all + +env: + ZIP_MODE: ${{ github.event.inputs.zip_mode }} jobs: build-bundles: @@ -32,32 +39,62 @@ jobs: - name: Run manage.sh build-bundle from host run: ./manage.sh build-bundle - - name: Create global README and package all bundles + - name: Create README and zip bundles run: | - echo "# Penpot Bundles" > bundles/README.md - echo "" >> bundles/README.md - echo "This package contains the automatically built Penpot artifacts (frontend, backend, and exporter) from the official repository." >> bundles/README.md - echo "" >> bundles/README.md - echo "## Contents" >> bundles/README.md - echo "" >> bundles/README.md - echo "- frontend/: Compiled frontend files of Penpot." >> bundles/README.md - echo "- backend/: Backend build artifacts of Penpot." >> bundles/README.md - echo "- exporter/: Module responsible for exporting resources from Penpot." >> bundles/README.md - echo "- README.md: This file." >> bundles/README.md - echo "" >> bundles/README.md - echo "## Usage" >> bundles/README.md - echo "" >> bundles/README.md - echo "1. Unzip the \"penpot-all-bundles.zip\" archive in your target environment." >> bundles/README.md - echo "2. Explore each subdirectory and follow the appropriate deployment steps for frontend, backend, and exporter based on your infrastructure." >> bundles/README.md - echo "3. You can use servers like NGINX to serve the frontend and Dockerized or custom environments to run backend/exporter services." >> bundles/README.md + echo "📦 Generating bundle documentation and packaging..." - cd bundles - mkdir all-in-one - cp -r ../frontend ../backend ../exporter README.md all-in-one/ - zip -r penpot-all-bundles.zip all-in-one + mkdir -p bundles - - name: Upload all-in-one bundle + echo "# Penpot Frontend Bundle" > frontend/README.md + echo "This bundle contains the compiled frontend of Penpot. To deploy, serve it via a static file server like NGINX." >> frontend/README.md + + echo "# Penpot Backend Bundle" > backend/README.md + echo "This bundle contains the backend services of Penpot. Deploy in a containerized or server environment supporting Clojure/Java." >> backend/README.md + + echo "# Penpot Exporter Bundle" > exporter/README.md + echo "This bundle includes Penpot's export service. Use alongside backend for complete document conversion features." >> exporter/README.md + + if [[ "${ZIP_MODE}" == "all" ]]; then + echo "Creating unified penpot-all-bundles.zip" + cp -r frontend backend exporter bundles/ + echo "# Penpot Bundles" > bundles/README.md + echo "" >> bundles/README.md + echo "This package contains all Penpot components: frontend, backend, and exporter." >> bundles/README.md + echo "Refer to each subdirectory for specific deployment instructions." >> bundles/README.md + cd bundles + mkdir all-in-one + mv frontend backend exporter README.md all-in-one/ + zip -r penpot-all-bundles.zip all-in-one + else + echo "Creating individual zip files" + zip -r frontend.zip frontend + zip -r backend.zip backend + zip -r exporter.zip exporter + + - name: Upload unified bundle + if: env.ZIP_MODE == 'all' uses: actions/upload-artifact@v4 with: name: penpot-all-bundles path: bundles/penpot-all-bundles.zip + + - name: Upload frontend bundle + if: env.ZIP_MODE != 'all' + uses: actions/upload-artifact@v4 + with: + name: frontend-bundle + path: frontend.zip + + - name: Upload backend bundle + if: env.ZIP_MODE != 'all' + uses: actions/upload-artifact@v4 + with: + name: backend-bundle + path: backend.zip + + - name: Upload exporter bundle + if: env.ZIP_MODE != 'all' + uses: actions/upload-artifact@v4 + with: + name: exporter-bundle + path: exporter.zip \ No newline at end of file From e146ce7be40abc026f0068466ade80b248488155 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 13:39:09 +0200 Subject: [PATCH 13/14] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=F0=9F=A7=AA=20t?= =?UTF-8?q?emporary=20debug=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index d7bb12ecbd..f65d8dc226 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -11,7 +11,9 @@ on: options: - individual - all - + push: + branches: + - github-actions-bundle-build env: ZIP_MODE: ${{ github.event.inputs.zip_mode }} From 689063cfb218826a085288ad79a6f7188aaae224 Mon Sep 17 00:00:00 2001 From: fsantiago Date: Tue, 6 May 2025 13:59:15 +0200 Subject: [PATCH 14/14] =?UTF-8?q?:sparkles:=20=E2=9C=A8=20add=20initial=20?= =?UTF-8?q?functionality?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-bundles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index f65d8dc226..8cbd73bb37 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -72,7 +72,7 @@ jobs: zip -r frontend.zip frontend zip -r backend.zip backend zip -r exporter.zip exporter - + fi - name: Upload unified bundle if: env.ZIP_MODE == 'all' uses: actions/upload-artifact@v4