mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
fix: canary for arm64 macos (#22187)
This doesn't actually trigger the arm64 build job nightly yet. I'll do that in a follow up.
This commit is contained in:
parent
d730956f49
commit
d923705d9d
3 changed files with 71 additions and 47 deletions
21
.github/workflows/ci.generate.ts
vendored
21
.github/workflows/ci.generate.ts
vendored
|
@ -747,31 +747,18 @@ const ci = {
|
|||
"Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-x86_64-pc-windows-msvc.zip",
|
||||
},
|
||||
{
|
||||
name: "Upload canary to dl.deno.land (unix)",
|
||||
name: "Upload canary to dl.deno.land",
|
||||
if: [
|
||||
"runner.os != 'Windows' &&",
|
||||
"matrix.job == 'test' &&",
|
||||
"matrix.profile == 'release' &&",
|
||||
"github.repository == 'denoland/deno' &&",
|
||||
"github.ref == 'refs/heads/main'",
|
||||
].join("\n"),
|
||||
run:
|
||||
run: [
|
||||
'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/',
|
||||
},
|
||||
{
|
||||
name: "Upload canary to dl.deno.land (windows)",
|
||||
if: [
|
||||
"runner.os == 'Windows' &&",
|
||||
"matrix.job == 'test' &&",
|
||||
"matrix.profile == 'release' &&",
|
||||
"github.repository == 'denoland/deno' &&",
|
||||
"github.ref == 'refs/heads/main'",
|
||||
"echo ${{ github.sha }} > canary-latest.txt",
|
||||
'gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt',
|
||||
].join("\n"),
|
||||
env: {
|
||||
CLOUDSDK_PYTHON: "${{env.pythonLocation}}\\python.exe",
|
||||
},
|
||||
run:
|
||||
'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/',
|
||||
},
|
||||
{
|
||||
name: "Autobahn testsuite",
|
||||
|
|
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
|
@ -437,24 +437,16 @@ jobs:
|
|||
github.repository == 'denoland/deno')
|
||||
shell: pwsh
|
||||
run: Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-x86_64-pc-windows-msvc.zip
|
||||
- name: Upload canary to dl.deno.land (unix)
|
||||
- name: Upload canary to dl.deno.land
|
||||
if: |-
|
||||
!(matrix.skip) && (runner.os != 'Windows' &&
|
||||
matrix.job == 'test' &&
|
||||
!(matrix.skip) && (matrix.job == 'test' &&
|
||||
matrix.profile == 'release' &&
|
||||
github.repository == 'denoland/deno' &&
|
||||
github.ref == 'refs/heads/main')
|
||||
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/'
|
||||
- name: Upload canary to dl.deno.land (windows)
|
||||
if: |-
|
||||
!(matrix.skip) && (runner.os == 'Windows' &&
|
||||
matrix.job == 'test' &&
|
||||
matrix.profile == 'release' &&
|
||||
github.repository == 'denoland/deno' &&
|
||||
github.ref == 'refs/heads/main')
|
||||
env:
|
||||
CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
|
||||
run: 'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/'
|
||||
run: |-
|
||||
gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
|
||||
echo ${{ github.sha }} > canary-latest.txt
|
||||
gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
|
||||
- name: Autobahn testsuite
|
||||
if: |-
|
||||
!(matrix.skip) && (matrix.job == 'test' && matrix.profile == 'release' &&
|
||||
|
|
|
@ -483,12 +483,6 @@ pub async fn upgrade(
|
|||
};
|
||||
|
||||
let download_url = if upgrade_flags.canary {
|
||||
// NOTE(bartlomieju): to keep clippy happy on M1 macs.
|
||||
#[allow(clippy::eq_op)]
|
||||
if env!("TARGET") == "aarch64-apple-darwin" {
|
||||
bail!("Canary builds are not available for M1/M2");
|
||||
}
|
||||
|
||||
format!(
|
||||
"https://dl.deno.land/canary/{}/{}",
|
||||
install_version, *ARCHIVE_NAME
|
||||
|
@ -502,7 +496,7 @@ pub async fn upgrade(
|
|||
|
||||
let archive_data = download_package(client, &download_url)
|
||||
.await
|
||||
.with_context(|| format!("Failed downloading {download_url}"))?;
|
||||
.with_context(|| format!("Failed downloading {download_url}. The version you requested may not have been built for the current architechture."))?;
|
||||
|
||||
log::info!("Deno is upgrading to version {}", &install_version);
|
||||
|
||||
|
@ -568,7 +562,7 @@ async fn get_latest_version(
|
|||
release_kind: UpgradeReleaseKind,
|
||||
check_kind: UpgradeCheckKind,
|
||||
) -> Result<String, AnyError> {
|
||||
let url = get_url(release_kind, check_kind);
|
||||
let url = get_url(release_kind, env!("TARGET"), check_kind);
|
||||
let text = client.download_text(url).await?;
|
||||
Ok(normalize_version_from_server(release_kind, &text))
|
||||
}
|
||||
|
@ -586,11 +580,14 @@ fn normalize_version_from_server(
|
|||
|
||||
fn get_url(
|
||||
release_kind: UpgradeReleaseKind,
|
||||
target_tuple: &str,
|
||||
check_kind: UpgradeCheckKind,
|
||||
) -> String {
|
||||
let file_name = match release_kind {
|
||||
UpgradeReleaseKind::Stable => "release-latest.txt",
|
||||
UpgradeReleaseKind::Canary => "canary-latest.txt",
|
||||
UpgradeReleaseKind::Stable => Cow::Borrowed("release-latest.txt"),
|
||||
UpgradeReleaseKind::Canary => {
|
||||
Cow::Owned(format!("canary-{target_tuple}-latest.txt"))
|
||||
}
|
||||
};
|
||||
let query_param = match check_kind {
|
||||
UpgradeCheckKind::Execution => "",
|
||||
|
@ -1024,19 +1021,67 @@ mod test {
|
|||
#[test]
|
||||
fn test_get_url() {
|
||||
assert_eq!(
|
||||
get_url(UpgradeReleaseKind::Canary, UpgradeCheckKind::Execution),
|
||||
"https://dl.deno.land/canary-latest.txt"
|
||||
get_url(
|
||||
UpgradeReleaseKind::Canary,
|
||||
"aarch64-apple-darwin",
|
||||
UpgradeCheckKind::Execution
|
||||
),
|
||||
"https://dl.deno.land/canary-aarch64-apple-darwin-latest.txt"
|
||||
);
|
||||
assert_eq!(
|
||||
get_url(UpgradeReleaseKind::Canary, UpgradeCheckKind::Lsp),
|
||||
"https://dl.deno.land/canary-latest.txt?lsp"
|
||||
get_url(
|
||||
UpgradeReleaseKind::Canary,
|
||||
"aarch64-apple-darwin",
|
||||
UpgradeCheckKind::Lsp
|
||||
),
|
||||
"https://dl.deno.land/canary-aarch64-apple-darwin-latest.txt?lsp"
|
||||
);
|
||||
assert_eq!(
|
||||
get_url(UpgradeReleaseKind::Stable, UpgradeCheckKind::Execution),
|
||||
get_url(
|
||||
UpgradeReleaseKind::Canary,
|
||||
"x86_64-pc-windows-msvc",
|
||||
UpgradeCheckKind::Execution
|
||||
),
|
||||
"https://dl.deno.land/canary-x86_64-pc-windows-msvc-latest.txt"
|
||||
);
|
||||
assert_eq!(
|
||||
get_url(
|
||||
UpgradeReleaseKind::Canary,
|
||||
"x86_64-pc-windows-msvc",
|
||||
UpgradeCheckKind::Lsp
|
||||
),
|
||||
"https://dl.deno.land/canary-x86_64-pc-windows-msvc-latest.txt?lsp"
|
||||
);
|
||||
assert_eq!(
|
||||
get_url(
|
||||
UpgradeReleaseKind::Stable,
|
||||
"aarch64-apple-darwin",
|
||||
UpgradeCheckKind::Execution
|
||||
),
|
||||
"https://dl.deno.land/release-latest.txt"
|
||||
);
|
||||
assert_eq!(
|
||||
get_url(UpgradeReleaseKind::Stable, UpgradeCheckKind::Lsp),
|
||||
get_url(
|
||||
UpgradeReleaseKind::Stable,
|
||||
"aarch64-apple-darwin",
|
||||
UpgradeCheckKind::Lsp
|
||||
),
|
||||
"https://dl.deno.land/release-latest.txt?lsp"
|
||||
);
|
||||
assert_eq!(
|
||||
get_url(
|
||||
UpgradeReleaseKind::Stable,
|
||||
"x86_64-pc-windows-msvc",
|
||||
UpgradeCheckKind::Execution
|
||||
),
|
||||
"https://dl.deno.land/release-latest.txt"
|
||||
);
|
||||
assert_eq!(
|
||||
get_url(
|
||||
UpgradeReleaseKind::Stable,
|
||||
"x86_64-pc-windows-msvc",
|
||||
UpgradeCheckKind::Lsp
|
||||
),
|
||||
"https://dl.deno.land/release-latest.txt?lsp"
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue