From 358343b4df9d28c1e17e6c32ed9aae1baaafbcb5 Mon Sep 17 00:00:00 2001 From: Yamila Moreno Date: Wed, 20 Aug 2025 10:51:05 +0200 Subject: [PATCH] :paperclip: Add build tag workflow and minor changes --- .../{build-bundles.yml => build-bundle.yml} | 22 ++++++++++++------- .github/workflows/build-develop.yml | 4 ++-- .github/workflows/build-staging.yml | 4 ++-- .github/workflows/build-tag.yml | 13 +++++++++++ 4 files changed, 31 insertions(+), 12 deletions(-) rename .github/workflows/{build-bundles.yml => build-bundle.yml} (75%) create mode 100644 .github/workflows/build-tag.yml diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundle.yml similarity index 75% rename from .github/workflows/build-bundles.yml rename to .github/workflows/build-bundle.yml index e180df24c0..5053b44485 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundle.yml @@ -1,4 +1,4 @@ -name: Build and Upload Penpot Bundles +name: Build and Upload Penpot Bundle on: # Create bundle from manual action @@ -11,8 +11,8 @@ on: required: true jobs: - build-bundles: - name: Build and Upload Penpot Bundles + build-bundle: + name: Build and Upload Penpot Bundle runs-on: ubuntu-24.04 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -30,7 +30,7 @@ jobs: id: vars run: | echo "commit_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - echo "gh_branch=${{ inputs.gh_ref }}" >> $GITHUB_OUTPUT + echo "gh_ref=${{ inputs.gh_ref }}" >> $GITHUB_OUTPUT - name: Run manage.sh build-bundle from host run: ./manage.sh build-bundle @@ -40,16 +40,22 @@ jobs: mkdir zips mv bundles penpot - - name: Create zip bundles + - name: Create zip bundle run: | - echo "📦 Packaging Penpot bundles..." + echo "📦 Packaging Penpot bundle..." zip -r zips/penpot.zip penpot - name: Upload Penpot bundle to S3 + if: github.ref_type == 'branch' run: | - aws s3 cp zips/penpot.zip s3://${{ secrets.S3_BUCKET }}/penpot-${{ steps.vars.outputs.gh_branch}}-latest.zip + aws s3 cp zips/penpot.zip s3://${{ secrets.S3_BUCKET }}/penpot-${{ steps.vars.outputs.gh_ref }}-latest.zip aws s3 cp zips/penpot.zip s3://${{ secrets.S3_BUCKET }}/penpot-${{ steps.vars.outputs.commit_hash }}.zip + - name: Upload Penpot bundle to S3 + if: github.ref_type == 'tag' + run: | + aws s3 cp zips/penpot.zip s3://${{ secrets.S3_BUCKET }}/penpot-${{ steps.vars.outputs.gh_ref }}.zip + - name: Notify Mattermost if: failure() uses: mattermost/action-mattermost-notify@master @@ -57,5 +63,5 @@ jobs: MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }} TEXT: | ❌ *[PENPOT] Error during the execution of the job* - 📄 Triggered from ref: `${{ steps.vars.outputs.gh_branch}}` + 📄 Triggered from ref: `${{ steps.vars.outputs.gh_ref }}` 🔗 Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index dddcceeeb9..d62a65aa98 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -1,4 +1,4 @@ -name: Build and Upload Penpot DEVELOP Bundles +name: Build and Upload Penpot DEVELOP Bundle on: schedule: @@ -6,7 +6,7 @@ on: jobs: build-develop-bundle: - uses: ./.github/workflows/build-bundles.yml + uses: ./.github/workflows/build-bundle.yml secrets: inherit with: gh_ref: "develop" diff --git a/.github/workflows/build-staging.yml b/.github/workflows/build-staging.yml index b3920e9fec..26aca0fa11 100644 --- a/.github/workflows/build-staging.yml +++ b/.github/workflows/build-staging.yml @@ -1,4 +1,4 @@ -name: Build and Upload Penpot STAGING Bundles +name: Build and Upload Penpot STAGING Bundle on: schedule: @@ -6,7 +6,7 @@ on: jobs: build-staging-bundle: - uses: ./.github/workflows/build-bundles.yml + uses: ./.github/workflows/build-bundle.yml secrets: inherit with: gh_ref: "staging" diff --git a/.github/workflows/build-tag.yml b/.github/workflows/build-tag.yml new file mode 100644 index 0000000000..aec3ebcf83 --- /dev/null +++ b/.github/workflows/build-tag.yml @@ -0,0 +1,13 @@ +name: Build and Upload Penpot TAG Bundle + +on: + push: + tags: + - '*' + +jobs: + build-tag-bundle: + uses: ./.github/workflows/build-bundle.yml + secrets: inherit + with: + gh_ref: ${{ github.ref_name }}