Skip to content
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ workflows:
<<: *filters-tag-triggered-workflow-job
name: upload-to-s3-for-install-linux-feature-build
s3-target-path: slack-cli
file-name: "slack_cli_*feature_linux_64-bit.tar.gz"
file-name: "slack_cli_*feature_linux_*.tar.gz"
requires:
- create-github-release-and-artifacts
context: slack-cli-release
Expand Down
6 changes: 6 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ builds:
- windows
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64

- id: slack-macos
binary: bin/slack
Expand Down Expand Up @@ -74,6 +78,8 @@ archives:
{{- .Env.BUILD_VERSION }}_
{{- if eq .Os "darwin" -}}
macOS_{{ if eq .Arch "all" }}64-bit{{ else }}{{ .Arch }}{{ end }}
{{- else if eq .Os "linux" -}}
linux_{{ .Arch }}
{{- else -}}
{{ .Os }}_{{ if eq .Arch "amd64" }}64-bit{{ else }}{{ .Arch }}{{ end }}
{{- end }}
Expand Down
9 changes: 8 additions & 1 deletion internal/update/cli_autoupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ func getUpdateFileName(version, operatingSys, architecture string) (filename str
filename = fmt.Sprintf("slack_cli_%s_macOS_64-bit.zip", version)
}
case "linux":
filename = fmt.Sprintf("slack_cli_%s_linux_64-bit.tar.gz", version)
switch architecture {
case "amd64":
filename = fmt.Sprintf("slack_cli_%s_linux_amd64.tar.gz", version)
case "arm64":
filename = fmt.Sprintf("slack_cli_%s_linux_arm64.tar.gz", version)
default:
filename = fmt.Sprintf("slack_cli_%s_linux_64-bit.tar.gz", version)
}
case "windows":
filename = fmt.Sprintf("slack_cli_%s_windows_64-bit.zip", version)
default:
Expand Down
22 changes: 20 additions & 2 deletions internal/update/cli_autoupdate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,31 @@ func Test_CLI_getUpdateFileName(t *testing.T) {
version: "3.4.5",
operatingSystem: "linux",
architecture: "amd64",
expectedFilename: "slack_cli_3.4.5_linux_64-bit.tar.gz",
expectedFilename: "slack_cli_3.4.5_linux_amd64.tar.gz",
},
"linux development x86_64": {
version: "3.4.5-6-badaabad",
operatingSystem: "linux",
architecture: "amd64",
expectedFilename: "slack_cli_3.4.5-6-badaabad_linux_64-bit.tar.gz",
expectedFilename: "slack_cli_3.4.5-6-badaabad_linux_amd64.tar.gz",
},
"linux production arm64": {
version: "3.4.5",
operatingSystem: "linux",
architecture: "arm64",
expectedFilename: "slack_cli_3.4.5_linux_arm64.tar.gz",
},
"linux development arm64": {
version: "3.4.5-6-badaabad",
operatingSystem: "linux",
architecture: "arm64",
expectedFilename: "slack_cli_3.4.5-6-badaabad_linux_arm64.tar.gz",
},
"linux production unknown arch fallback": {
version: "3.4.5",
operatingSystem: "linux",
architecture: "riscv64",
expectedFilename: "slack_cli_3.4.5_linux_64-bit.tar.gz",
},
"windows production x86_64": {
version: "3.4.5",
Expand Down
6 changes: 6 additions & 0 deletions scripts/archive-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ main() {

echo "Checking Linux archives"
check_tar "$DIST_DIR/slack_cli_${VERSION}_linux_64-bit.tar.gz"
check_tar "$DIST_DIR/slack_cli_${VERSION}_linux_amd64.tar.gz"
check_tar "$DIST_DIR/slack_cli_${VERSION}_linux_arm64.tar.gz"
check_tar "$DIST_DIR/slack_cli_dev_linux_64-bit.tar.gz"
check_tar "$DIST_DIR/slack_cli_dev_linux_amd64.tar.gz"
check_tar "$DIST_DIR/slack_cli_dev_linux_arm64.tar.gz"
check_tar "$DIST_DIR/slack_cli_latest_linux_64-bit.tar.gz"
check_tar "$DIST_DIR/slack_cli_latest_linux_amd64.tar.gz"
check_tar "$DIST_DIR/slack_cli_latest_linux_arm64.tar.gz"

echo "Checking Windows archives"
check_exe "$DIST_DIR/slack_cli_${VERSION}_windows_64-bit.zip"
Expand Down
30 changes: 22 additions & 8 deletions scripts/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,30 @@ main() {

echo "Creating Linux archives"

linux_targz_file_path_version="$DIST_DIR/slack_cli_${VERSION}_linux_64-bit.tar.gz"
linux_targz_file_path_dev="$DIST_DIR/slack_cli_dev_linux_64-bit.tar.gz"
linux_targz_file_path_latest="$DIST_DIR/slack_cli_latest_linux_64-bit.tar.gz"

echo "-> Creating Linux development tar.gz file"
cp "$linux_targz_file_path_version" "$linux_targz_file_path_dev"
linux_targz_file_path_version_64bit="$DIST_DIR/slack_cli_${VERSION}_linux_64-bit.tar.gz"
linux_targz_file_path_version_amd64="$DIST_DIR/slack_cli_${VERSION}_linux_amd64.tar.gz"
linux_targz_file_path_version_arm64="$DIST_DIR/slack_cli_${VERSION}_linux_arm64.tar.gz"
linux_targz_file_path_dev_64bit="$DIST_DIR/slack_cli_dev_linux_64-bit.tar.gz"
linux_targz_file_path_dev_amd64="$DIST_DIR/slack_cli_dev_linux_amd64.tar.gz"
linux_targz_file_path_dev_arm64="$DIST_DIR/slack_cli_dev_linux_arm64.tar.gz"
linux_targz_file_path_latest_64bit="$DIST_DIR/slack_cli_latest_linux_64-bit.tar.gz"
linux_targz_file_path_latest_amd64="$DIST_DIR/slack_cli_latest_linux_amd64.tar.gz"
linux_targz_file_path_latest_arm64="$DIST_DIR/slack_cli_latest_linux_arm64.tar.gz"

echo "-> Creating Linux fallback tar.gz files"
cp "$linux_targz_file_path_version_amd64" "$linux_targz_file_path_version_64bit"
ls -l "$DIST_DIR"/*_"$VERSION"_linux*

echo "-> Creating Linux development tar.gz files"
cp "$linux_targz_file_path_version_amd64" "$linux_targz_file_path_dev_64bit"
cp "$linux_targz_file_path_version_amd64" "$linux_targz_file_path_dev_amd64"
cp "$linux_targz_file_path_version_arm64" "$linux_targz_file_path_dev_arm64"
ls -l "$DIST_DIR"/*dev_linux*

echo "-> Creating Linux production tar.gz file"
cp "$linux_targz_file_path_version" "$linux_targz_file_path_latest"
echo "-> Creating Linux latest tar.gz files"
cp "$linux_targz_file_path_version_amd64" "$linux_targz_file_path_latest_64bit"
cp "$linux_targz_file_path_version_amd64" "$linux_targz_file_path_latest_amd64"
cp "$linux_targz_file_path_version_arm64" "$linux_targz_file_path_latest_arm64"
ls -l "$DIST_DIR"/*latest_linux*

echo "Creating Windows archives"
Expand Down
16 changes: 15 additions & 1 deletion scripts/install-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,21 @@ install_slack_cli() {
esac
fi
elif [ "$(expr substr "$(uname -s)" 1 5)" == "Linux" ]; then
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_DEV_VERSION}_linux_64-bit.tar.gz"
if version_lt "$SLACK_CLI_DEV_VERSION" "4.2.0"; then
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_DEV_VERSION}_linux_64-bit.tar.gz"
else
case "$(uname -m)" in
x86_64)
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_DEV_VERSION}_linux_amd64.tar.gz"
;;
aarch64 | arm64)
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_DEV_VERSION}_linux_arm64.tar.gz"
;;
*)
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_DEV_VERSION}_linux_64-bit.tar.gz"
;;
esac
fi
else
echo "🛑 Error: This installer is only supported on Linux and macOS"
echo "🔖 Try using a different installation method:"
Expand Down
16 changes: 15 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,21 @@ install_slack_cli() {
esac
fi
elif [ "$(expr substr "$(uname -s)" 1 5)" == "Linux" ]; then
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_VERSION}_linux_64-bit.tar.gz"
if version_lt "$SLACK_CLI_VERSION" "4.2.0"; then
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_VERSION}_linux_64-bit.tar.gz"
else
case "$(uname -m)" in
x86_64)
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_VERSION}_linux_amd64.tar.gz"
;;
aarch64 | arm64)
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_VERSION}_linux_arm64.tar.gz"
;;
*)
slack_cli_url="https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_VERSION}_linux_64-bit.tar.gz"
;;
esac
fi
else
echo "🛑 Error: This installer is only supported on Linux and macOS"
echo "🔖 Try using a different installation method:"
Expand Down
Loading