Make arm64 compatible
This commit is contained in:
@@ -18,7 +18,6 @@ on:
|
||||
env:
|
||||
SLUG: ${{ github.repository_owner }}/ubuntu
|
||||
DISTRO: ubuntu
|
||||
PLATFORMS: linux/amd64
|
||||
NODE: '14'
|
||||
BUILD_REF: ${{ github.sha }}
|
||||
SKIP_TEST: false
|
||||
@@ -34,7 +33,17 @@ jobs:
|
||||
fail-fast: true
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
TAG: [latest, 20.04, 18.04, 16.04]
|
||||
include:
|
||||
- TAG: latest
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
- TAG: 20.04
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
- TAG: 18.04
|
||||
PLATFORMS: linux/amd64
|
||||
- TAG: 16.04
|
||||
PLATFORMS: linux/amd64
|
||||
env:
|
||||
PLATFORMS: ${{ matrix.PLATFORMS }}
|
||||
steps:
|
||||
- name: Login to GitHub Container Registry
|
||||
if: ${{ github.repository_owner == github.actor }}
|
||||
@@ -162,9 +171,27 @@ jobs:
|
||||
fail-fast: false
|
||||
max-parallel: 2
|
||||
matrix:
|
||||
TAG: [latest, 20.04, 18.04]
|
||||
TYPE: [js, pwsh]
|
||||
include:
|
||||
- TAG: latest
|
||||
TYPE: js
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
- TAG: latest
|
||||
TYPE: pwsh
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
- TAG: 20.04
|
||||
TYPE: js
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
- TAG: 20.04
|
||||
TYPE: pwsh
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
- TAG: 18.04
|
||||
TYPE: js
|
||||
PLATFORMS: linux/amd64
|
||||
- TAG: 18.04
|
||||
TYPE: pwsh
|
||||
PLATFORMS: linux/amd64
|
||||
env:
|
||||
PLATFORMS: ${{ matrix.PLATFORMS }}
|
||||
BUILD_TAG: ${{ matrix.TYPE }}-${{ matrix.TAG }}
|
||||
TAG: ${{ matrix.TYPE }}-${{ matrix.TAG }}
|
||||
TYPE: ${{ matrix.TYPE }}
|
||||
|
||||
@@ -90,10 +90,13 @@ printf "\n\t🐋 Installed moby-buildx 🐋\t\n"
|
||||
docker buildx version
|
||||
|
||||
printf "\n\t🐋 Installing Node.JS 🐋\t\n"
|
||||
ARCH=$(uname -m)
|
||||
if [ "$ARCH" = x86_64 ]; then ARCH=x64; fi
|
||||
if [ "$ARCH" = aarch64 ]; then ARCH=arm64; fi
|
||||
VER=$(curl https://nodejs.org/download/release/index.json | jq "[.[] | select(.version|test(\"^v${NODE_VERSION}\"))][0].version" -r)
|
||||
NODEPATH="$AGENT_TOOLSDIRECTORY/node/${VER:1}/x64"
|
||||
NODEPATH="$AGENT_TOOLSDIRECTORY/node/${VER:1}/$ARCH"
|
||||
mkdir -v -m 0777 -p "$NODEPATH"
|
||||
curl -SsL "https://nodejs.org/download/release/latest-v${NODE_VERSION}.x/node-$VER-linux-x64.tar.xz" | tar -Jxf - --strip-components=1 -C "$NODEPATH"
|
||||
curl -SsL "https://nodejs.org/download/release/latest-v${NODE_VERSION}.x/node-$VER-linux-$ARCH.tar.xz" | tar -Jxf - --strip-components=1 -C "$NODEPATH"
|
||||
sed "s|^PATH=|PATH=$NODEPATH/bin:|mg" -i /etc/environment
|
||||
export PATH="$NODEPATH/bin:$PATH"
|
||||
|
||||
|
||||
@@ -21,7 +21,10 @@ for V in $(jq -r '.toolcache[] | select(.name == "go") | .versions[]' "/imagegen
|
||||
GOPATH="$AGENT_TOOLSDIRECTORY/go/${VER}/x64"
|
||||
|
||||
mkdir -v -m 0777 -p "$GOPATH"
|
||||
wget -qO- "https://golang.org/dl/go${VER}.linux-amd64.tar.gz" | tar -zxf - --strip-components=1 -C "$GOPATH"
|
||||
ARCH=$(uname -m)
|
||||
if [ "$ARCH" = x86_64 ]; then ARCH=amd64; fi
|
||||
if [ "$ARCH" = aarch64 ]; then ARCH=arm64; fi
|
||||
wget -qO- "https://golang.org/dl/go${VER}.linux-$ARCH.tar.gz" | tar -zxf - --strip-components=1 -C "$GOPATH"
|
||||
|
||||
ENVVAR="${V//\./_}"
|
||||
echo "${ENVVAR}=${GOPATH}" >>/etc/environment
|
||||
|
||||
@@ -23,7 +23,10 @@ for V in "${versions[@]}"; do
|
||||
# disable warning about 'mkdir -m -p'
|
||||
# shellcheck disable=SC2174
|
||||
mkdir -v -m 0777 -p "$NODEPATH"
|
||||
wget -qO- "https://nodejs.org/download/release/latest-v${V}.x/node-$VER-linux-x64.tar.xz" | tar -Jxf - --strip-components=1 -C "$NODEPATH"
|
||||
ARCH=$(uname -m)
|
||||
if [ "$ARCH" = x86_64 ]; then ARCH=x64; fi
|
||||
if [ "$ARCH" = aarch64 ]; then ARCH=arm64; fi
|
||||
wget -qO- "https://nodejs.org/download/release/latest-v${V}.x/node-$VER-linux-$ARCH.tar.xz" | tar -Jxf - --strip-components=1 -C "$NODEPATH"
|
||||
|
||||
ENVVAR="${V//\./_}"
|
||||
echo "${ENVVAR}=${NODEPATH}" >>/etc/environment
|
||||
|
||||
@@ -3,8 +3,26 @@
|
||||
set -Eeuxo pipefail
|
||||
|
||||
printf "\n\t🐋 Installing PowerShell 🐋\t\n"
|
||||
sudo apt-get -yq update
|
||||
sudo apt-get -yq install powershell
|
||||
|
||||
# While an linux/amd64 platform installation can use apt-get, the linux/arm64
|
||||
# platform installation can't as described here:
|
||||
# https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#support-for-arm-processors
|
||||
#
|
||||
# Due to that, we rely on the binary installation method for both platforms, as
|
||||
# described here:
|
||||
# https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#linux
|
||||
#
|
||||
|
||||
ARCH=$(uname -m)
|
||||
if [ "$ARCH" = x86_64 ]; then ARCH=x64; fi
|
||||
if [ "$ARCH" = aarch64 ]; then ARCH=arm64; fi
|
||||
VER=$(curl --silent "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" | jq -r .tag_name)
|
||||
curl -L -o /tmp/powershell.tar.gz "https://github.com/PowerShell/PowerShell/releases/download/$VER/powershell-${VER:1}-linux-$ARCH.tar.gz"
|
||||
sudo mkdir -p "/opt/microsoft/powershell/${VER:1:1}"
|
||||
sudo tar zxf /tmp/powershell.tar.gz -C "/opt/microsoft/powershell/${VER:1:1}"
|
||||
sudo chmod +x "/opt/microsoft/powershell/${VER:1:1}/pwsh"
|
||||
sudo ln -s "/opt/microsoft/powershell/${VER:1:1}/pwsh" /usr/bin/pwsh
|
||||
rm /tmp/powershell.tar.gz
|
||||
|
||||
printf "\n\t🐋 Installed PWSH 🐋\t\n"
|
||||
pwsh -v
|
||||
@@ -13,12 +31,6 @@ printf "\n\t🐋 Installing PowerShell modules 🐋\t\n"
|
||||
modules=("MarkdownPS" "Pester" "PSScriptAnalyzer")
|
||||
|
||||
for mod in "${modules[@]}"; do
|
||||
printf "\n\t🐋 Installing %s 🐋\t\n" "${mod}"
|
||||
pwsh -nol -nop -c "Install-Module -Name ${mod} -Scope AllUsers -SkipPublisherCheck -Force"
|
||||
printf "\n\t🐋 Installing %s 🐋\t\n" "${mod}"
|
||||
pwsh -nol -nop -c "Install-Module -Name ${mod} -Scope AllUsers -SkipPublisherCheck -Force"
|
||||
done
|
||||
|
||||
printf "\n\t🐋 Cleaning image 🐋\t\n"
|
||||
apt-get clean
|
||||
rm -rf /var/cache/* /var/log/* /var/lib/apt/lists/* /tmp/* || echo 'Failed to delete directories'
|
||||
|
||||
printf "\n\t🐋 Cleaned up image 🐋\t\n"
|
||||
|
||||
Reference in New Issue
Block a user