Skip to content

Commit

Permalink
fix: use /refs/tags for tagged releases
Browse files Browse the repository at this point in the history
  • Loading branch information
willruggiano committed Dec 7, 2023
1 parent 742a27d commit 343e9de
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
};

devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [niv];
buildInputs = with pkgs; [niv ruff-lsp];
};

packages.${system} = let
Expand Down
12 changes: 6 additions & 6 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"rev": "v1.85.0",
"sha256": "0wc1hjr6y5yagpbn1dz47gqjmcqg0ba6as4d4b3yv2m8vbgcf5cq",
"type": "tarball",
"url": "https://github.com/microsoft/vscode-js-debug/archive/v1.85.0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
"url": "https://github.com/microsoft/vscode-js-debug/archive/refs/tags/v1.85.0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/refs/tags/<rev>.tar.gz"
},
"v1.84.0": {
"branch": "main",
Expand All @@ -20,8 +20,8 @@
"rev": "v1.84.0",
"sha256": "1mkjr4hvnx7sq7f0hg1j23j72mb9ng7nfrgmci8szn7p7135lfm8",
"type": "tarball",
"url": "https://github.com/microsoft/vscode-js-debug/archive/v1.84.0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
"url": "https://github.com/microsoft/vscode-js-debug/archive/refs/tags/v1.84.0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/refs/tags/<rev>.tar.gz"
},
"v1.85.0": {
"branch": "main",
Expand All @@ -32,7 +32,7 @@
"rev": "v1.85.0",
"sha256": "0wc1hjr6y5yagpbn1dz47gqjmcqg0ba6as4d4b3yv2m8vbgcf5cq",
"type": "tarball",
"url": "https://github.com/microsoft/vscode-js-debug/archive/v1.85.0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
"url": "https://github.com/microsoft/vscode-js-debug/archive/refs/tags/v1.85.0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/refs/tags/<rev>.tar.gz"
}
}
18 changes: 15 additions & 3 deletions scripts/update-sources/update-sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import subprocess

with open("nix/sources.json") as sources:
latest = semver.Version.parse(json.load(sources)['latest']['rev'].removeprefix("v"))
latest = semver.Version.parse(json.load(sources)["latest"]["rev"].removeprefix("v"))

versions = []
for line in fileinput.input(encoding="utf-8"):
Expand All @@ -13,7 +13,19 @@
versions.append(version)

for version in versions:
subprocess.run(['niv', 'add', 'microsoft/vscode-js-debug', '-n', f"v{version}", '-r', f"v{version}"])
subprocess.run(
[
"niv",
"add",
"microsoft/vscode-js-debug",
"-n",
f"v{version}",
"-r",
f"v{version}",
"-t",
"https://github.com/<owner>/<repo>/archive/refs/tags/<rev>.tar.gz",
]
)

if len(versions) > 0:
subprocess.run(['niv', 'update', 'latest', '-r', f"v{versions[-1]}"])
subprocess.run(["niv", "update", "latest", "-r", f"v{versions[-1]}"])

0 comments on commit 343e9de

Please sign in to comment.