From 04081d8b3e0013ba3ffd0bd54bf3a11da6a02631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereira?= <7235666+jomifepe@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:42:29 +0100 Subject: [PATCH 1/2] ci(mac): add step to build and release macos arm64 binary --- .github/workflows/build-cli.yml | 25 +++++++++++++------------ apps/cli/package.json | 4 ++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index ad2ac539715..afdcb43cc59 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -61,13 +61,14 @@ jobs: cli: - name: "${{ matrix.os.base }} - ${{ matrix.license_type.readable }}" + name: "${{ matrix.os.base }}${{ matrix.os.target_suffix }} - ${{ matrix.license_type.readable }}" strategy: matrix: os: [ - { base: "linux", distro: "ubuntu-22.04" }, - { base: "mac", distro: "macos-13" } + { base: "linux", distro: "ubuntu-22.04", target_suffix: "" }, + { base: "mac", distro: "macos-13", target_suffix: "" }, + { base: "mac", distro: "macos-14", target_suffix: "-arm64" } ] license_type: [ @@ -108,12 +109,12 @@ jobs: - name: Zip Unix run: | - cd ./dist/${{ matrix.license_type.build_prefix }}/${{ env.LOWER_RUNNER_OS }} - zip ../../bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip ./bw + cd ./dist/${{ matrix.license_type.build_prefix }}/${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }} + zip ../../bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip ./bw - name: Version Test run: | - unzip "./dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip" -d "./test" + unzip "./dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip" -d "./test" testVersion=$(./test/bw -v) echo "version: $_PACKAGE_VERSION" echo "testVersion: $testVersion" @@ -125,22 +126,22 @@ jobs: - name: Create checksums Unix run: | cd ./dist - shasum -a 256 bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip \ + shasum -a 256 bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip \ | awk '{split($0, a); print a[1]}' > bw${{ - matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt + matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt - name: Upload unix zip asset uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip - path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip + name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip + path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip if-no-files-found: error - name: Upload unix checksum asset uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt - path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt + name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt + path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt if-no-files-found: error cli-windows: diff --git a/apps/cli/package.json b/apps/cli/package.json index d8258117fc9..0ac61653122 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -32,15 +32,19 @@ "build:bit:prod:watch": "cross-env NODE_ENV=production npm run build:bit:watch", "dist:oss:win": "npm run build:oss:prod && npm run clean && npm run package:oss:win", "dist:oss:mac": "npm run build:oss:prod && npm run clean && npm run package:oss:mac", + "dist:oss:mac-arm64": "npm run build:oss:prod && npm run clean && npm run package:oss:mac-arm64", "dist:oss:lin": "npm run build:oss:prod && npm run clean && npm run package:oss:lin", "dist:bit:win": "npm run build:bit:prod && npm run clean && npm run package:bit:win", "dist:bit:mac": "npm run build:bit:prod && npm run clean && npm run package:bit:mac", + "dist:bit:mac-arm64": "npm run build:bit:prod && npm run clean && npm run package:bit:mac-arm64", "dist:bit:lin": "npm run build:bit:prod && npm run clean && npm run package:bit:lin", "package:oss:win": "pkg . --targets win-x64 --output ./dist/oss/windows/bw.exe", "package:oss:mac": "pkg . --targets macos-x64 --output ./dist/oss/macos/bw", + "package:oss:mac-arm64": "pkg . --targets macos-arm64 --output ./dist/oss/macos-arm64/bw", "package:oss:lin": "pkg . --targets linux-x64 --output ./dist/oss/linux/bw", "package:bit:win": "pkg . --targets win-x64 --output ./dist/bit/windows/bw.exe", "package:bit:mac": "pkg . --targets macos-x64 --output ./dist/bit/macos/bw", + "package:bit:mac-arm64": "pkg . --targets macos-arm64 --output ./dist/bit/macos-arm64/bw", "package:bit:lin": "pkg . --targets linux-x64 --output ./dist/bit/linux/bw", "test": "jest", "test:watch": "jest --watch", From 45227aa006e57a102b854ce309673e535524363e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereira?= <7235666+jomifepe@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:42:29 +0100 Subject: [PATCH 2/2] ci(mac): add step to build and release macos arm64 binary --- .github/workflows/build-cli.yml | 25 +++++++++++++------------ apps/cli/package.json | 4 ++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index ad2ac539715..afdcb43cc59 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -61,13 +61,14 @@ jobs: cli: - name: "${{ matrix.os.base }} - ${{ matrix.license_type.readable }}" + name: "${{ matrix.os.base }}${{ matrix.os.target_suffix }} - ${{ matrix.license_type.readable }}" strategy: matrix: os: [ - { base: "linux", distro: "ubuntu-22.04" }, - { base: "mac", distro: "macos-13" } + { base: "linux", distro: "ubuntu-22.04", target_suffix: "" }, + { base: "mac", distro: "macos-13", target_suffix: "" }, + { base: "mac", distro: "macos-14", target_suffix: "-arm64" } ] license_type: [ @@ -108,12 +109,12 @@ jobs: - name: Zip Unix run: | - cd ./dist/${{ matrix.license_type.build_prefix }}/${{ env.LOWER_RUNNER_OS }} - zip ../../bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip ./bw + cd ./dist/${{ matrix.license_type.build_prefix }}/${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }} + zip ../../bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip ./bw - name: Version Test run: | - unzip "./dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip" -d "./test" + unzip "./dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip" -d "./test" testVersion=$(./test/bw -v) echo "version: $_PACKAGE_VERSION" echo "testVersion: $testVersion" @@ -125,22 +126,22 @@ jobs: - name: Create checksums Unix run: | cd ./dist - shasum -a 256 bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip \ + shasum -a 256 bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip \ | awk '{split($0, a); print a[1]}' > bw${{ - matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt + matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt - name: Upload unix zip asset uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip - path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip + name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip + path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip if-no-files-found: error - name: Upload unix checksum asset uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt - path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt + name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt + path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt if-no-files-found: error cli-windows: diff --git a/apps/cli/package.json b/apps/cli/package.json index cb0c2a01678..4565c0f228b 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -32,15 +32,19 @@ "build:bit:prod:watch": "cross-env NODE_ENV=production npm run build:bit:watch", "dist:oss:win": "npm run build:oss:prod && npm run clean && npm run package:oss:win", "dist:oss:mac": "npm run build:oss:prod && npm run clean && npm run package:oss:mac", + "dist:oss:mac-arm64": "npm run build:oss:prod && npm run clean && npm run package:oss:mac-arm64", "dist:oss:lin": "npm run build:oss:prod && npm run clean && npm run package:oss:lin", "dist:bit:win": "npm run build:bit:prod && npm run clean && npm run package:bit:win", "dist:bit:mac": "npm run build:bit:prod && npm run clean && npm run package:bit:mac", + "dist:bit:mac-arm64": "npm run build:bit:prod && npm run clean && npm run package:bit:mac-arm64", "dist:bit:lin": "npm run build:bit:prod && npm run clean && npm run package:bit:lin", "package:oss:win": "pkg . --targets win-x64 --output ./dist/oss/windows/bw.exe", "package:oss:mac": "pkg . --targets macos-x64 --output ./dist/oss/macos/bw", + "package:oss:mac-arm64": "pkg . --targets macos-arm64 --output ./dist/oss/macos-arm64/bw", "package:oss:lin": "pkg . --targets linux-x64 --output ./dist/oss/linux/bw", "package:bit:win": "pkg . --targets win-x64 --output ./dist/bit/windows/bw.exe", "package:bit:mac": "pkg . --targets macos-x64 --output ./dist/bit/macos/bw", + "package:bit:mac-arm64": "pkg . --targets macos-arm64 --output ./dist/bit/macos-arm64/bw", "package:bit:lin": "pkg . --targets linux-x64 --output ./dist/bit/linux/bw", "test": "jest", "test:watch": "jest --watch",