From 49f3c04e158e0c473b497cd43dd52a57a3e4c186 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 13:08:44 -0300 Subject: [PATCH] Update Electron 31.6.0 (#2948) * update electron 31.6.0 --- .github/workflows/pull-request-build.yml | 102 +++++++++++++++-------- package.json | 4 +- yarn.lock | 10 +-- 3 files changed, 74 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index 07441fa96..586ac6577 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -58,14 +58,14 @@ jobs: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} - name: Build Windows Package - if: ${{ matrix.os == 'windows-latest'}} + if: ${{ matrix.os == 'windows-latest' }} run: yarn electron-builder --publish never --x64 --win nsis env: CSC_LINK: ${{ secrets.WIN_CSC_LINK }} CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} - name: Build MacOS Package - if: ${{ matrix.os == 'macos-latest'}} + if: ${{ matrix.os == 'macos-latest' }} run: | sudo mdutil -a -i off yarn electron-builder --publish never --mac --universal @@ -79,49 +79,81 @@ jobs: ASC_PROVIDER: 'S6UPZG7ZR3' - name: Build Ubuntu Package - if: ${{ matrix.os == 'ubuntu-latest'}} + if: ${{ matrix.os == 'ubuntu-latest' }} run: yarn electron-builder --publish never --linux snap - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ runner.os }} Artifacts - path: | - dist/rocketchat-*.dmg - dist/rocketchat-*.pkg - dist/rocketchat-*.exe - dist/rocketchat-*.snap - - - name: Get Artifact URL - id: get-artifact-url + # Install AWS CLI + - name: Install AWS CLI + run: pip install awscli + + # Upload artifacts to Wasabi (Windows) + - name: Upload Artifacts to Wasabi (Windows) + if: ${{ matrix.os == 'windows-latest' }} + run: | + aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }}/${{ matrix.os }}/ --recursive ` + --acl public-read ` + --endpoint-url=https://s3.us-east-1.wasabisys.com ` + --exclude "*" ` + --include "rocketchat-*.exe" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.WASABI_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.WASABI_SECRET_ACCESS_KEY }} + + # Upload artifacts to Wasabi (macOS) + - name: Upload Artifacts to Wasabi (macOS) + if: ${{ matrix.os == 'macos-latest' }} + run: | + aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }}/${{ matrix.os }}/ --recursive \ + --acl public-read \ + --endpoint-url=https://s3.us-east-1.wasabisys.com \ + --exclude "*" \ + --include "rocketchat-*.dmg" \ + --include "rocketchat-*.pkg" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.WASABI_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.WASABI_SECRET_ACCESS_KEY }} + + # Upload artifacts to Wasabi (Ubuntu) + - name: Upload Artifacts to Wasabi (Ubuntu) + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }}/${{ matrix.os }}/ --recursive \ + --acl public-read \ + --endpoint-url=https://s3.us-east-1.wasabisys.com \ + --exclude "*" \ + --include "rocketchat-*.snap" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.WASABI_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.WASABI_SECRET_ACCESS_KEY }} + + # Get Artifact URLs using actions/github-script (only specified file extensions) + - name: Get Artifact URLs + id: get-artifact-urls uses: actions/github-script@v6 with: script: | - const owner = context.repo.owner; - const repo = context.repo.repo; - const runId = context.runId; - - const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner, - repo, - run_id: runId - }); - - const artifact = artifacts.data.artifacts.find(a => a.name === '${{ runner.os }} Artifacts'); - if (artifact) { - const url = `https://github.com/${owner}/${repo}/actions/runs/${runId}/artifacts/${artifact.id}`; - core.setOutput('artifact_url', url); - } else { - core.setFailed(`Artifact not found for ${artifact.name}`); + const fs = require('fs'); + const path = require('path'); + const distDir = path.join(process.cwd(), 'dist'); + const files = fs.readdirSync(distDir); + const patterns = [/rocketchat-.*\.dmg$/, /rocketchat-.*\.pkg$/, /rocketchat-.*\.exe$/, /rocketchat-.*\.snap$/]; + let artifactUrls = ''; + for (const file of files) { + if (patterns.some(pattern => pattern.test(file))) { + const artifactUrl = `https://s3.us-east-1.wasabisys.com/${{ secrets.WASABI_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }}/${{ matrix.os }}/${file}`; + artifactUrls += `- [${file}](${artifactUrl})\n`; + } } + core.setOutput('artifact_urls', artifactUrls.trim()); - - name: Post PR Comment with the Artifact link - if: steps.get-artifact-url.outputs.artifact_url != '' + - name: Post PR Comment with the Artifact links + if: steps.get-artifact-urls.outputs.artifact_urls != '' uses: marocchino/sticky-pull-request-comment@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} message: | - ### [${{ runner.os }} installer download](${{ steps.get-artifact-url.outputs.artifact_url }}) - header: '### Artifact for ${{ runner.os }}' + ### ${{ runner.os }} installer download + ${{ steps.get-artifact-urls.outputs.artifact_urls }} + header: '### ${{ runner.os }} installer download' recreate: true append: false diff --git a/package.json b/package.json index 65580ec6d..8f7ea8816 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "productName": "Rocket.Chat", "name": "rocketchat", "description": "Official OSX, Windows, and Linux Desktop Clients for Rocket.Chat", - "version": "4.1.0", + "version": "4.1.1", "author": "Rocket.Chat Support ", "copyright": "© 2016-2024, Rocket.Chat", "homepage": "https://rocket.chat", @@ -109,7 +109,7 @@ "chokidar": "~3.5.3", "conventional-changelog-cli": "~4.1.0", "convert-svg-to-png": "~0.6.4", - "electron": "30.4.0", + "electron": "31.6.0", "electron-builder": "24.13.3", "electron-devtools-installer": "^3.2.0", "electron-notarize": "^1.2.2", diff --git a/yarn.lock b/yarn.lock index cec403d00..7017a2b00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9008,16 +9008,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:30.4.0": - version: 30.4.0 - resolution: "electron@npm:30.4.0" +"electron@npm:31.6.0": + version: 31.6.0 + resolution: "electron@npm:31.6.0" dependencies: "@electron/get": "npm:^2.0.0" "@types/node": "npm:^20.9.0" extract-zip: "npm:^2.0.1" bin: electron: cli.js - checksum: a79a43e7b074b1cc028140fadebe7fb10d27d388bc20210086533738b19a763e85cc91ffb5584e85e3ef3caa35f7293dd12363aebff2d8a28a0eac24998f4908 + checksum: ef304dd279a6f01143de000d3be420bde8f6feb5b72387c2b22e64fd97e1d5b80a0e82e4f2dee660b36a8a682e4f9cbcd2e6d2f73f5e7ba4e84d8bfb03c1d8e2 languageName: node linkType: hard @@ -15544,7 +15544,7 @@ __metadata: chokidar: "npm:~3.5.3" conventional-changelog-cli: "npm:~4.1.0" convert-svg-to-png: "npm:~0.6.4" - electron: "npm:30.4.0" + electron: "npm:31.6.0" electron-builder: "npm:24.13.3" electron-devtools-installer: "npm:^3.2.0" electron-dl: "npm:3.5.2"