From 6419680ba70dcac8d59066077fadd3ead07aa053 Mon Sep 17 00:00:00 2001 From: Avery Harnish Date: Wed, 10 Feb 2021 13:30:26 -0600 Subject: [PATCH] feat(CI): adds Big Sur to all CI jobs --- .github/workflows/release.yml | 37 ++++++++++++++++++++-- .github/workflows/test-nightly.yml | 4 +++ .github/workflows/test.yml | 11 ++++++- installers/binstall/scripts/nix/install.sh | 17 ++++++---- installers/npm/binary.js | 6 ++++ 5 files changed, 64 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9737a0282..ccfe740e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,7 @@ env: GITHUB_REF: "${{ github.ref }}" WINDOWS_TARGET: x86_64-pc-windows-msvc MACOS_TARGET: x86_64-apple-darwin + MACOS_BIG_SUR_TARGET: aarch64-apple-darwin LINUX_TARGET: x86_64-unknown-linux-musl # Space separated paths to include in the archive. @@ -22,7 +23,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - build: [linux, macos, windows] + build: + [ + linux, + macos, + macos-big-sur, + windows + ] include: - build: linux os: ubuntu-latest @@ -30,6 +37,9 @@ jobs: - build: macos os: macos-latest rust: stable + - build: macos-big-sur + os: macos-11.0 + rust: stable - build: windows os: windows-latest rust: stable @@ -134,6 +144,13 @@ jobs: mv ${{ env.RELEASE_ADDS }} ./dist 7z a -ttar -so -an ./dist | 7z a -si ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.tar.gz + - name: Create tarball (MacOS Big Sur) + if: matrix.build == 'macos-big-sur' + run: | + mv ./target/release/${{ env.RELEASE_BIN }} ./dist/${{ env.RELEASE_BIN }} + mv ${{ env.RELEASE_ADDS }} ./dist + 7z a -ttar -so -an ./dist | 7z a -si ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_BIG_SUR_TARGET }}.tar.gz + - name: Upload Zip uses: actions/upload-artifact@v1 with: @@ -161,6 +178,8 @@ jobs: tar -xzvf ./linux/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.LINUX_TARGET }}.tar.gz && mv ./dist/${{ env.RELEASE_BIN }} ./linux-cli && rm -rf dist tar -xzvf ./windows/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.WINDOWS_TARGET }}.tar.gz && mv ./dist/${{ env.RELEASE_BIN }}.exe ./windows-cli.exe && rm -rf dist tar -xzvf ./macos/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.tar.gz && mv ./dist/${{ env.RELEASE_BIN }} ./macos-cli && rm -rf dist + tar -xzvf ./macos-big-sur/${{ env.RELEASE_BIN }}-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_BIG_SUR_TARGET }}.tar.gz && mv ./dist/${{ env.RELEASE_BIN }} ./macos-big-sur-cli && rm -rf dist + - name: Hash binaries id: get_shas @@ -169,6 +188,7 @@ jobs: echo ::set-output name=linux::"- __Linux__: $(sha256sum -b linux-cli | cut -d ' ' -f1)" echo ::set-output name=windows::"- __Windows__: $(sha256sum -b windows-cli.exe | cut -d ' ' -f1)" echo ::set-output name=macos::"- __MacOS__: $(sha256sum -b macos-cli | cut -d ' ' -f1)" + echo ::set-output name=macos-big-sur::"- __MacOS_Big_Sur__: $(sha256sum -b macos-big-sur-cli | cut -d ' ' -f1)" - name: Create Release id: create_release @@ -187,7 +207,8 @@ jobs: ### SHA256 of release binaries for validation: ${{ steps.get_shas.outputs.LINUX }} ${{ steps.get_shas.outputs.WINDOWS }} - ${{ steps.get_shas.outputs.MACOS }} + ${{ steps.get_shas.outputs.MACOS }} + ${{ steps.get_shas.outputs.MACOS_BIG_SUR }} - name: Release Linux tarball uses: actions/upload-release-asset@v1 @@ -217,4 +238,14 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./macos/rover-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.tar.gz asset_content_type: application/gzip - asset_name: rover-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.tar.gz \ No newline at end of file + asset_name: rover-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.tar.gz + + - name: Release MacOS Big Sur tarball + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./macos-big-sur/rover-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_BIG_SUR_TARGET }}.tar.gz + asset_content_type: application/gzip + asset_name: rover-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_BIG_SUR_TARGET }}.tar.gz \ No newline at end of file diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index f214168ee..e1bbb6290 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -13,6 +13,7 @@ jobs: [ linux-nightly, macos-nightly, + macos-big-sur-nightly, windows-nightly, ] include: @@ -22,6 +23,9 @@ jobs: - build: macos-nightly os: macos-latest rust: nightly + - build: macos-big-sur-nightly + os: macos-11.0 + rust: nightly - build: windows-nightly os: windows-latest rust: nightly diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 883488990..25d22f5ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - build: [linux-stable, macos-stable, windows-stable] + build: + [ + linux-stable, + macos-stable, + macos-big-sur, + windows-stable + ] include: - build: linux-stable os: ubuntu-latest @@ -17,6 +23,9 @@ jobs: - build: macos-stable os: macos-latest rust: stable + - build: macos-big-sur + os: macos-11.0 + rust: stable - build: windows-stable os: windows-latest rust: stable diff --git a/installers/binstall/scripts/nix/install.sh b/installers/binstall/scripts/nix/install.sh index 76525e835..b4949f3c3 100755 --- a/installers/binstall/scripts/nix/install.sh +++ b/installers/binstall/scripts/nix/install.sh @@ -11,7 +11,7 @@ set -u -BINARY_DOWNLOAD_PREFIX="https://github.com/apollographql/rover/releases/download/$VERSION" +BINARY_DOWNLOAD_PREFIX="https://github.com/EverlastingBugstopper/rover/releases/download/$VERSION" download_binary_and_run_installer() { downloader --check @@ -43,7 +43,7 @@ download_binary_and_run_installer() { local _file="$_dir/input.tar.gz" local _rover="$_dir/rover$_ext" - say "downloading rover" 1>&2 + say "downloading rover from $_url" 1>&2 ensure mkdir -p "$_dir" downloader "$_url" "$_file" @@ -82,7 +82,11 @@ get_architecture() { if [ "$_ostype" = Darwin -a "$_cputype" = i386 ]; then # Darwin `uname -s` lies if sysctl hw.optional.x86_64 | grep -q ': 1'; then - local _cputype=x86_64 + local _cputype=aarch-64 + fi + + if sysctl hw.optional.arm64 | grep -q ': 1'; then + local _cputype=aarch-64 fi fi @@ -105,8 +109,7 @@ get_architecture() { esac case "$_cputype" in - x86_64 | x86-64 | x64 | amd64) - local _cputype=x86_64 + x86_64 | x86-64 | x64 | amd64 | aarch-64) ;; *) err "no precompiled binaries available for CPU architecture: $_cputype" @@ -122,13 +125,13 @@ get_architecture() { say() { local green=`tput setaf 2` local reset=`tput sgr0` - echo " ${green}INFO${reset} sh::wrapper: $1" + echo "$1" } err() { local red=`tput setaf 1` local reset=`tput sgr0` - say " ${red}ERROR${reset} sh::wrapper: $1" >&2 + say "${red}ERROR${reset}: $1" >&2 exit 1 } diff --git a/installers/npm/binary.js b/installers/npm/binary.js index 52d7483d8..93610e1a7 100644 --- a/installers/npm/binary.js +++ b/installers/npm/binary.js @@ -30,6 +30,12 @@ const supportedPlatforms = [ RUST_TARGET: "x86_64-apple-darwin", BINARY_NAME: name, }, + { + TYPE: "Darwin", + ARCHITECTURE: "arm64", + RUST_TARGET: "aarch64-apple-darwin", + BINARY_NAME: name + } ]; const getPlatform = () => {