diff --git a/.changeset/tiny-jobs-laugh.md b/.changeset/tiny-jobs-laugh.md new file mode 100644 index 0000000..4ea4d66 --- /dev/null +++ b/.changeset/tiny-jobs-laugh.md @@ -0,0 +1,5 @@ +--- +"pactup": patch +--- + +fix nightly install diff --git a/Cargo.toml b/Cargo.toml index ff41499..223e4e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ log = "0.4" node-semver = "2.1" sysinfo = "0.31" tar = "0.4" -tempfile = "3.12" +tempfile = "3.13" thiserror = "1.0" zip = "2.2" duct = "0.13" @@ -41,7 +41,7 @@ test-log = "0.2" flate2 = "1.0" walkdir = "2.5" indicatif = { version = "0.17", features = ["improved_unicode"] } -regex = "1.10" +regex = "1.11" [dev-dependencies] pretty_assertions = "1.4" diff --git a/package.json b/package.json index 1809c72..b49d235 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "url": "git@github.com:kadena-community/pactup.git" }, "author": "Salama Ashoush ", - "packageManager": "pnpm@9.11.0", + "packageManager": "pnpm@9.12.0", "license": "MIT", "description": "Linter for the JavaScript Oxidation Compiler", "keywords": [ @@ -44,7 +44,7 @@ }, "devDependencies": { "@changesets/changelog-github": "0.5.0", - "@changesets/cli": "2.27.8", + "@changesets/cli": "2.27.9", "@types/node": "^22.7.4", "@types/shell-escape": "^0.2.3", "chalk": "^5.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d16aec..edac1f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: 0.5.0 version: 0.5.0(encoding@0.1.13) '@changesets/cli': - specifier: 2.27.8 - version: 2.27.8 + specifier: 2.27.9 + version: 2.27.9 '@types/node': specifier: ^22.7.4 version: 22.7.4 @@ -72,8 +72,8 @@ packages: '@changesets/changelog-github@0.5.0': resolution: {integrity: sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==} - '@changesets/cli@2.27.8': - resolution: {integrity: sha512-gZNyh+LdSsI82wBSHLQ3QN5J30P4uHKJ4fXgoGwQxfXwYFTJzDdvIJasZn8rYQtmKhyQuiBj4SSnLuKlxKWq4w==} + '@changesets/cli@2.27.9': + resolution: {integrity: sha512-q42a/ZbDnxPpCb5Wkm6tMVIxgeI9C/bexntzTeCFBrQEdpisQqk8kCHllYZMDjYtEc1ZzumbMJAG8H0Z4rdvjg==} hasBin: true '@changesets/config@3.0.3': @@ -383,9 +383,6 @@ packages: '@types/q@1.5.8': resolution: {integrity: sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/shell-escape@0.2.3': resolution: {integrity: sha512-xZWkMuQkn1I20gEzhYRa4/t1pwZ8XiIkqGA1Iee1D2IgAUIRLr57nrgJgF2QmHEfkfVzOM59gi/4xp6V+Aq+4A==} @@ -2058,7 +2055,7 @@ snapshots: transitivePeerDependencies: - encoding - '@changesets/cli@2.27.8': + '@changesets/cli@2.27.9': dependencies: '@changesets/apply-release-plan': 7.0.5 '@changesets/assemble-release-plan': 6.0.4 @@ -2075,14 +2072,12 @@ snapshots: '@changesets/types': 6.0.0 '@changesets/write': 0.3.2 '@manypkg/get-packages': 1.1.3 - '@types/semver': 7.5.8 ansi-colors: 4.1.3 ci-info: 3.9.0 enquirer: 2.4.1 external-editor: 3.1.0 fs-extra: 7.0.1 mri: 1.2.0 - outdent: 0.5.0 p-limit: 2.3.0 package-manager-detector: 0.2.0 picocolors: 1.1.0 @@ -2395,8 +2390,6 @@ snapshots: '@types/q@1.5.8': {} - '@types/semver@7.5.8': {} - '@types/shell-escape@0.2.3': {} abcq@1.0.2: diff --git a/src/remote_pact_index.rs b/src/remote_pact_index.rs index 9ed20fb..1925b27 100644 --- a/src/remote_pact_index.rs +++ b/src/remote_pact_index.rs @@ -36,8 +36,8 @@ impl Release { match platform { Platform(PlatformOS::Linux, PlatformArch::X64) => { let regex = if version.is_nightly() { - // match the nightly version format for linux pact-binary-bundle.ubuntu-*. - r"^(pact-binary-bundle\.ubuntu-latest|pact-nightly-linux(-\d+\.\d+)?)\.(tar\.gz|zip)$" + // match the nightly version format for linux pact-nightly-linux-x64. + r"^pact-nightly-linux-x64\.(tar\.gz|zip)$" } else { // match the stable version format for linux pact---. r"^pact-(\d+(\.\d+){0,2})(-(linux|ubuntu))?(-\d+\.\d+)?\.(tar\.gz|zip)$" @@ -46,8 +46,8 @@ impl Release { } Platform(PlatformOS::MacOS, PlatformArch::X64) => { let regex = if version.is_nightly() { - // match the nightly version format for mac pact-binary-bundle.macos-latest. - r"^(pact-binary-bundle\.macos-latest|pact-nightly-osx)\.(tar\.gz|zip)$" + // match the nightly version format for mac pact-nightly-darwin-x64. + r"^pact-nightly-darwin-x64\.(tar\.gz|zip)$" } else { // match the stable version format for mac pact--osx. r"^pact-(\d+(\.\d+){0,2})-osx\.(tar\.gz|zip)$" @@ -56,8 +56,8 @@ impl Release { } Platform(PlatformOS::MacOS, PlatformArch::Arm64) => { let regex = if version.is_nightly() { - // match the nightly version format for mac pact-binary-bundle.macos-m1. - r"^(pact-binary-bundle\.macos-m1|pact-nightly-aarch64-osx)\.(tar\.gz|zip)$" + // match the nightly version format for mac pact-nightly-darwin-aarch64. + r"^pact-nightly-darwin-aarch64\.(tar\.gz|zip)$" } else { // match the stable version format for mac pact--aarch64-osx. r"^pact-(\d+(\.\d+){0,2})-aarch64-osx\.(tar\.gz|zip)$" @@ -168,7 +168,7 @@ mod tests { assert!(!release.unwrap().is_nightly()); let repo = "kadena-io/pact-5".to_string(); - let expected_version = Version::parse("development-latest").unwrap(); + let expected_version = Version::parse("nightly").unwrap(); let mut versions = list(&repo).expect("Can't get HTTP data"); let release = versions .drain(..) @@ -188,7 +188,7 @@ mod tests { assert!(release.has_supported_asset()); let repo = "kadena-io/pact-5".to_string(); - let tag = "development-latest".to_string(); + let tag = "nightly".to_string(); let release = get_by_tag(&repo, &tag).expect("Can't get HTTP data"); assert_eq!(release.tag_name.to_string(), tag); assert!(release.tag_name.is_nightly()); @@ -202,17 +202,12 @@ mod tests { let release = latest(&repo).expect("Can't get HTTP data"); assert!(!release.tag_name.is_nightly()); assert!(release.has_supported_asset()); - - let repo = "kadena-io/pact-5".to_string(); - let release = latest(&repo).expect("Can't get HTTP data"); - assert!(release.tag_name.is_nightly()); - assert!(release.has_supported_asset()); } #[test] fn test_version_matcher_nightly_linux() { let release = Release { - tag_name: Version::parse("development-latest").unwrap(), + tag_name: Version::parse("nightly").unwrap(), assets: vec![], prerelease: false, draft: false, @@ -220,11 +215,8 @@ mod tests { let platform = Platform(PlatformOS::Linux, PlatformArch::X64); let regex = release.version_matcher_for_platform(&platform).unwrap(); - // Old naming convention - assert!(regex.is_match("pact-binary-bundle.ubuntu-latest.tar.gz")); // New naming convention - assert!(regex.is_match("pact-nightly-linux.tar.gz")); - assert!(regex.is_match("pact-nightly-linux-22.04.tar.gz")); + assert!(regex.is_match("pact-nightly-linux-x64.tar.gz")); // Should not match stable versions assert!(!regex.is_match("pact-4.11.0-linux.tar.gz")); } @@ -245,14 +237,13 @@ mod tests { assert!(regex.is_match("pact-4.11.0-ubuntu.tar.gz")); assert!(regex.is_match("pact-4.11.0-ubuntu-22.04.tar.gz")); // Should not match nightly builds - assert!(!regex.is_match("pact-nightly-linux.tar.gz")); - assert!(!regex.is_match("pact-binary-bundle.ubuntu-latest.tar.gz")); + assert!(!regex.is_match("pact-nightly-linux-x64.tar.gz")); } #[test] fn test_version_matcher_nightly_macos_x64() { let release = Release { - tag_name: Version::parse("development-latest").unwrap(), + tag_name: Version::parse("nightly").unwrap(), assets: vec![], prerelease: false, draft: false, @@ -261,10 +252,8 @@ mod tests { let platform = Platform(PlatformOS::MacOS, PlatformArch::X64); let regex = release.version_matcher_for_platform(&platform).unwrap(); - // Old naming convention - assert!(regex.is_match("pact-binary-bundle.macos-latest.tar.gz")); // New naming convention - assert!(regex.is_match("pact-nightly-osx.tar.gz")); + assert!(regex.is_match("pact-nightly-darwin-x64.tar.gz")); // Should not match stable versions assert!(!regex.is_match("pact-4.11.0-osx.tar.gz")); } @@ -283,14 +272,13 @@ mod tests { assert!(regex.is_match("pact-4.11.0-osx.tar.gz")); // Should not match nightly builds - assert!(!regex.is_match("pact-nightly-osx.tar.gz")); - assert!(!regex.is_match("pact-binary-bundle.macos-latest.tar.gz")); + assert!(!regex.is_match("pact-nightly-darwin-aarch64.tar.gz")); } #[test] fn test_version_matcher_nightly_macos_arm64() { let release = Release { - tag_name: Version::parse("development-latest").unwrap(), + tag_name: Version::parse("nightly").unwrap(), assets: vec![], prerelease: false, draft: false, @@ -298,10 +286,8 @@ mod tests { let platform = Platform(PlatformOS::MacOS, PlatformArch::Arm64); let regex = release.version_matcher_for_platform(&platform).unwrap(); - // Old naming convention - assert!(regex.is_match("pact-binary-bundle.macos-m1.tar.gz")); // New naming convention - assert!(regex.is_match("pact-nightly-aarch64-osx.tar.gz")); + assert!(regex.is_match("pact-nightly-darwin-aarch64.tar.gz")); // Should not match stable versions assert!(!regex.is_match("pact-4.11.0-aarch64-osx.tar.gz")); } @@ -319,7 +305,6 @@ mod tests { assert!(regex.is_match("pact-4.11.0-aarch64-osx.tar.gz")); // Should not match nightly builds - assert!(!regex.is_match("pact-nightly-aarch64-osx.tar.gz")); - assert!(!regex.is_match("pact-binary-bundle.macos-m1.tar.gz")); + assert!(!regex.is_match("pact-nightly-darwin-aarch64.tar.gz")); } }