From 1c32b743e5efed71b1dee9f3e181426ee923ea60 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Mon, 23 Sep 2024 22:02:24 -0300 Subject: [PATCH 01/11] update electron 31.6.0 --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 65580ec6d..12c06fb55 100644 --- a/package.json +++ b/package.json @@ -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" From c51a773790225987df32892975cfb68cda8ea16a Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Mon, 23 Sep 2024 22:02:59 -0300 Subject: [PATCH 02/11] bump versions --- electron-builder.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/electron-builder.json b/electron-builder.json index 65ad271bb..4d0e74ab2 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -10,7 +10,7 @@ "category": "public.app-category.productivity", "target": ["dmg", "pkg", "zip", "mas"], "icon": "build/icon.icns", - "bundleVersion": "24091", + "bundleVersion": "24092", "helperBundleId": "chat.rocket.electron.helper", "type": "distribution", "artifactName": "rocketchat-${version}-${os}.${ext}", diff --git a/package.json b/package.json index 12c06fb55..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", From 7e65eed9feb278970d2ef628c474ea52b7eae0ab Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Tue, 24 Sep 2024 10:59:03 -0300 Subject: [PATCH 03/11] bump build --- electron-builder.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron-builder.json b/electron-builder.json index 4d0e74ab2..65ad271bb 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -10,7 +10,7 @@ "category": "public.app-category.productivity", "target": ["dmg", "pkg", "zip", "mas"], "icon": "build/icon.icns", - "bundleVersion": "24092", + "bundleVersion": "24091", "helperBundleId": "chat.rocket.electron.helper", "type": "distribution", "artifactName": "rocketchat-${version}-${os}.${ext}", From f6c028d5d8f14dbeb80d57a2509a51e952092bc5 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 07:22:02 -0300 Subject: [PATCH 04/11] add wasabi as artifacts storage --- .github/workflows/pull-request-build.yml | 73 +++++++++++++----------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index 07441fa96..525d34b2a 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -82,46 +82,55 @@ jobs: 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 + # Remove the 'Upload Artifacts' step that uses 'actions/upload-artifact@v4' + # - 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 + + # Install AWS CLI + - name: Install AWS CLI + run: | + pip install awscli + + # Upload artifacts to Wasabi + - name: Upload Artifacts to Wasabi + run: | + aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/ --recursive --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com + 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 + - 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); + let artifactUrls = ''; + for (const file of files) { + const artifactUrl = `https://s3.us-east-1.wasabisys.com/${{ secrets.WASABI_BUCKET_NAME }}/${{ 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 }}' + ### Artifact for ${{ matrix.os }} + ${{ steps.get-artifact-urls.outputs.artifact_urls }} + header: '### Artifact for ${{ matrix.os }}' recreate: true append: false From f739d51c79edb673f82b41e52ca0554aec9fd398 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 07:31:33 -0300 Subject: [PATCH 05/11] filter files to upload --- .github/workflows/pull-request-build.yml | 82 +++++++++++++++++------- 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index 525d34b2a..b99d185d8 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,83 @@ 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 - # Remove the 'Upload Artifacts' step that uses 'actions/upload-artifact@v4' - # - 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 - # Install AWS CLI - name: Install AWS CLI + uses: aws-actions/setup-aws-cli@v2 + + # Upload artifacts to Wasabi (Windows) + - name: Upload Artifacts to Wasabi (Windows) + if: matrix.os == 'windows-latest' run: | - pip install awscli + aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/windows-latest/ --recursive --exclude "*" --include "rocketchat-*.exe" --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com + shell: pwsh + env: + AWS_ACCESS_KEY_ID: ${{ secrets.WASABI_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.WASABI_SECRET_ACCESS_KEY }} - # Upload artifacts to Wasabi - - name: Upload Artifacts to Wasabi + # 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 }}/${{ matrix.os }}/ --recursive --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com + aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/macos-latest/ --recursive --exclude "*" --include "rocketchat-*.dmg" --include "rocketchat-*.pkg" --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com + shell: bash 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 + # 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 }}/ubuntu-latest/ --recursive --exclude "*" --include "rocketchat-*.snap" --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com + shell: bash + env: + AWS_ACCESS_KEY_ID: ${{ secrets.WASABI_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.WASABI_SECRET_ACCESS_KEY }} + + # Get Artifact URLs - name: Get Artifact URLs id: get-artifact-urls uses: actions/github-script@v6 with: script: | + const os = '${{ matrix.os }}'; + const bucketName = '${{ secrets.WASABI_BUCKET_NAME }}'; + const endpoint = 'https://s3.wasabisys.com'; + const artifactDir = 'dist'; + const fs = require('fs'); const path = require('path'); - const distDir = path.join(process.cwd(), 'dist'); - const files = fs.readdirSync(distDir); + + let patterns = []; + if (os === 'windows-latest') { + patterns = ['rocketchat-*.exe']; + } else if (os === 'macos-latest') { + patterns = ['rocketchat-*.dmg', 'rocketchat-*.pkg']; + } else if (os === 'ubuntu-latest') { + patterns = ['rocketchat-*.snap']; + } else { + core.setFailed(`Unsupported OS: ${os}`); + } + + const glob = require('glob'); + let artifactUrls = ''; - for (const file of files) { - const artifactUrl = `https://s3.us-east-1.wasabisys.com/${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/${file}`; - artifactUrls += `- [${file}](${artifactUrl})\n`; + for (const pattern of patterns) { + const files = glob.sync(path.join(artifactDir, pattern)); + for (const file of files) { + const fileName = path.basename(file); + const artifactUrl = `${endpoint}/${bucketName}/${os}/${fileName}`; + artifactUrls += `- [${fileName}](${artifactUrl})\n`; + } } core.setOutput('artifact_urls', artifactUrls.trim()); + # Install glob dependency + prelude: | + const glob = require('glob'); - name: Post PR Comment with the Artifact links if: steps.get-artifact-urls.outputs.artifact_urls != '' From 2c4122d51f2ee6cbab15d0cdd94a2d778122151e Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 07:34:49 -0300 Subject: [PATCH 06/11] fix --- .github/workflows/pull-request-build.yml | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index b99d185d8..6bda5306e 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -82,9 +82,27 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: yarn electron-builder --publish never --linux snap - # Install AWS CLI - - name: Install AWS CLI - uses: aws-actions/setup-aws-cli@v2 + # Install AWS CLI based on the OS + - name: Install AWS CLI on Ubuntu + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y unzip + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + sudo ./aws/install + + - name: Install AWS CLI on macOS + if: runner.os == 'macOS' + run: | + brew install awscli + + - name: Install AWS CLI on Windows + if: runner.os == 'Windows' + run: | + Invoke-WebRequest -Uri "https://awscli.amazonaws.com/AWSCLIV2.msi" -OutFile "C:\awscliv2.msi" + Start-Process msiexec.exe -Wait -ArgumentList '/i C:\awscliv2.msi /qn' + shell: pwsh # Upload artifacts to Wasabi (Windows) - name: Upload Artifacts to Wasabi (Windows) @@ -124,7 +142,7 @@ jobs: script: | const os = '${{ matrix.os }}'; const bucketName = '${{ secrets.WASABI_BUCKET_NAME }}'; - const endpoint = 'https://s3.wasabisys.com'; + const endpoint = 'https://s3..wasabisys.com'; const artifactDir = 'dist'; const fs = require('fs'); From 997db941d5bf0d7d9cb576ed2d02b8ac17c6fc85 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 07:40:38 -0300 Subject: [PATCH 07/11] fix --- .github/workflows/pull-request-build.yml | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index 6bda5306e..c9c6b88d4 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -82,27 +82,9 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: yarn electron-builder --publish never --linux snap - # Install AWS CLI based on the OS - - name: Install AWS CLI on Ubuntu - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y unzip - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install - - - name: Install AWS CLI on macOS - if: runner.os == 'macOS' - run: | - brew install awscli - - - name: Install AWS CLI on Windows - if: runner.os == 'Windows' - run: | - Invoke-WebRequest -Uri "https://awscli.amazonaws.com/AWSCLIV2.msi" -OutFile "C:\awscliv2.msi" - Start-Process msiexec.exe -Wait -ArgumentList '/i C:\awscliv2.msi /qn' - shell: pwsh + # Verify AWS CLI Installation + - name: Verify AWS CLI Installation + run: aws --version # Upload artifacts to Wasabi (Windows) - name: Upload Artifacts to Wasabi (Windows) From 2dbb9c6e3d46d277195a1831d24a1a6bf6449d59 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 07:49:05 -0300 Subject: [PATCH 08/11] wasabi --- .github/workflows/pull-request-build.yml | 83 +++++++----------------- 1 file changed, 24 insertions(+), 59 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index c9c6b88d4..c7b14d8e7 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,83 +79,48 @@ 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 - # Verify AWS CLI Installation - - name: Verify AWS CLI Installation - run: aws --version - - # Upload artifacts to Wasabi (Windows) - - name: Upload Artifacts to Wasabi (Windows) - if: matrix.os == 'windows-latest' + # Install AWS CLI + - name: Install AWS CLI run: | - aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/windows-latest/ --recursive --exclude "*" --include "rocketchat-*.exe" --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com - shell: pwsh - 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 }}/macos-latest/ --recursive --exclude "*" --include "rocketchat-*.dmg" --include "rocketchat-*.pkg" --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com - shell: bash - env: - AWS_ACCESS_KEY_ID: ${{ secrets.WASABI_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.WASABI_SECRET_ACCESS_KEY }} + pip install awscli - # Upload artifacts to Wasabi (Ubuntu) - - name: Upload Artifacts to Wasabi (Ubuntu) - if: matrix.os == 'ubuntu-latest' + # Upload artifacts to Wasabi (only specified file extensions) + - name: Upload Artifacts to Wasabi run: | - aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/ubuntu-latest/ --recursive --exclude "*" --include "rocketchat-*.snap" --acl public-read --endpoint-url=https://s3.us-east-1.wasabisys.com - shell: bash + aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/ --recursive \ + --acl public-read \ + --endpoint-url=https://s3.wasabisys.com \ + --exclude "*" \ + --include "rocketchat-*.dmg" \ + --include "rocketchat-*.pkg" \ + --include "rocketchat-*.exe" \ + --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 + # 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 os = '${{ matrix.os }}'; - const bucketName = '${{ secrets.WASABI_BUCKET_NAME }}'; - const endpoint = 'https://s3..wasabisys.com'; - const artifactDir = 'dist'; - const fs = require('fs'); const path = require('path'); - - let patterns = []; - if (os === 'windows-latest') { - patterns = ['rocketchat-*.exe']; - } else if (os === 'macos-latest') { - patterns = ['rocketchat-*.dmg', 'rocketchat-*.pkg']; - } else if (os === 'ubuntu-latest') { - patterns = ['rocketchat-*.snap']; - } else { - core.setFailed(`Unsupported OS: ${os}`); - } - - const glob = require('glob'); - + 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 pattern of patterns) { - const files = glob.sync(path.join(artifactDir, pattern)); - for (const file of files) { - const fileName = path.basename(file); - const artifactUrl = `${endpoint}/${bucketName}/${os}/${fileName}`; - artifactUrls += `- [${fileName}](${artifactUrl})\n`; + for (const file of files) { + if (patterns.some(pattern => pattern.test(file))) { + const artifactUrl = `https://s3.wasabisys.com/${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/${file}`; + artifactUrls += `- [${file}](${artifactUrl})\n`; } } core.setOutput('artifact_urls', artifactUrls.trim()); - # Install glob dependency - prelude: | - const glob = require('glob'); - name: Post PR Comment with the Artifact links if: steps.get-artifact-urls.outputs.artifact_urls != '' From 027373669c0f8743193064283faf1b5ef933251d Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 08:00:47 -0300 Subject: [PATCH 09/11] fix --- .github/workflows/pull-request-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index c7b14d8e7..cdd761ae9 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -82,17 +82,17 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest'}} run: yarn electron-builder --publish never --linux snap - # Install AWS CLI + # Install AWS CLI using the official action - name: Install AWS CLI - run: | - pip install awscli + uses: aws-actions/setup-aws-cli@v2 # Upload artifacts to Wasabi (only specified file extensions) - name: Upload Artifacts to Wasabi + shell: bash run: | aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/ --recursive \ --acl public-read \ - --endpoint-url=https://s3.wasabisys.com \ + --endpoint-url=https://s3.us-east-1.wasabisys.com \ --exclude "*" \ --include "rocketchat-*.dmg" \ --include "rocketchat-*.pkg" \ @@ -116,7 +116,7 @@ jobs: let artifactUrls = ''; for (const file of files) { if (patterns.some(pattern => pattern.test(file))) { - const artifactUrl = `https://s3.wasabisys.com/${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/${file}`; + const artifactUrl = `https://s3.us-east-1.wasabisys.com/${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/${file}`; artifactUrls += `- [${file}](${artifactUrl})\n`; } } From 73f6a52cc77e054dbc87107dd2b1717e7b92e059 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 08:06:32 -0300 Subject: [PATCH 10/11] fix windows --- .github/workflows/pull-request-build.yml | 44 ++++++++++++++++++------ 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index cdd761ae9..4432253a7 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,24 +79,48 @@ 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 - # Install AWS CLI using the official action + # Install AWS CLI - name: Install AWS CLI - uses: aws-actions/setup-aws-cli@v2 + run: pip install awscli - # Upload artifacts to Wasabi (only specified file extensions) - - name: Upload Artifacts to Wasabi - shell: bash + # 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 }}/${{ 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 }}/${{ matrix.os }}/ --recursive \ --acl public-read \ --endpoint-url=https://s3.us-east-1.wasabisys.com \ --exclude "*" \ --include "rocketchat-*.dmg" \ - --include "rocketchat-*.pkg" \ - --include "rocketchat-*.exe" \ + --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 }}/${{ 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 }} From 87515b0edec1ecc277fe439ca85db302697aee16 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Wed, 25 Sep 2024 08:19:27 -0300 Subject: [PATCH 11/11] pr folder --- .github/workflows/pull-request-build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index 4432253a7..586ac6577 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -90,7 +90,7 @@ jobs: - name: Upload Artifacts to Wasabi (Windows) if: ${{ matrix.os == 'windows-latest' }} run: | - aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/ --recursive ` + 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 "*" ` @@ -103,7 +103,7 @@ jobs: - name: Upload Artifacts to Wasabi (macOS) if: ${{ matrix.os == 'macos-latest' }} run: | - aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/ --recursive \ + 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 "*" \ @@ -117,7 +117,7 @@ jobs: - name: Upload Artifacts to Wasabi (Ubuntu) if: ${{ matrix.os == 'ubuntu-latest' }} run: | - aws s3 cp dist/ s3://${{ secrets.WASABI_BUCKET_NAME }}/${{ matrix.os }}/ --recursive \ + 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 "*" \ @@ -140,7 +140,7 @@ jobs: 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 }}/${{ matrix.os }}/${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`; } } @@ -152,8 +152,8 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} message: | - ### Artifact for ${{ matrix.os }} + ### ${{ runner.os }} installer download ${{ steps.get-artifact-urls.outputs.artifact_urls }} - header: '### Artifact for ${{ matrix.os }}' + header: '### ${{ runner.os }} installer download' recreate: true append: false