Skip to content

Commit

Permalink
feat(CI): adds Big Sur to all CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper committed Feb 19, 2021
1 parent fe059a7 commit 6419680
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 11 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -22,14 +23,23 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos, windows]
build:
[
linux,
macos,
macos-big-sur,
windows
]
include:
- build: linux
os: ubuntu-latest
rust: stable
- build: macos
os: macos-latest
rust: stable
- build: macos-big-sur
os: macos-11.0
rust: stable
- build: windows
os: windows-latest
rust: stable
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
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
4 changes: 4 additions & 0 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
[
linux-nightly,
macos-nightly,
macos-big-sur-nightly,
windows-nightly,
]
include:
Expand All @@ -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
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@ 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
rust: stable
- 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
Expand Down
17 changes: 10 additions & 7 deletions installers/binstall/scripts/nix/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand All @@ -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
}

Expand Down
6 changes: 6 additions & 0 deletions installers/npm/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 6419680

Please sign in to comment.