mirror of
https://github.com/Mic92/nixos-wiki-infra.git
synced 2024-11-22 08:14:06 +01:00
Merge pull request #71 from NixOS/joerg-ci
fixup update-extension jobname
This commit is contained in:
commit
1460cc83e3
11
.github/workflows/update-extensions.yml
vendored
11
.github/workflows/update-extensions.yml
vendored
@ -3,9 +3,12 @@ on:
|
|||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '51 2 * * *'
|
- cron: "51 2 * * *"
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
jobs:
|
jobs:
|
||||||
update-submodules:
|
update-extensions:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -15,8 +18,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- run: ./modules/nixos-wiki/update-extensions.py ./modules/nixos-wiki/extensions.json
|
- run: ./modules/nixos-wiki/update-extensions.py ./modules/nixos-wiki/extensions.json
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v6
|
uses: peter-evans/create-pull-request@v6
|
||||||
with:
|
with:
|
||||||
title: Update zsh modules
|
title: Update mediawiki extensions
|
||||||
labels: merge-queue
|
labels: merge-queue
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ fetchurl }: {
|
{ fetchzip }: {
|
||||||
"MobileFrontend" = fetchurl { url = "https://github.com/NixOS/nixos-wiki-infra/releases/download/MobileFrontend-REL1_41-7e9d1d4.tar.gz/MobileFrontend-REL1_41-7e9d1d4.tar.gz"; sha256 = "1j9b2f5kxv68yl5652pqqfgchdkcc7p7j0afv2f3i4v6yz9ajr1n"; };
|
"MobileFrontend" = fetchzip { url = "https://github.com/NixOS/nixos-wiki-infra/releases/download/MobileFrontend-REL1_41-7e9d1d4.tar.gz/MobileFrontend-REL1_41-7e9d1d4.tar.gz"; sha256 = "0qk38j2mj9mny2qrzc4y56ng06mks3isz8gk90rgaw6ikcxg5dmj"; };
|
||||||
"DarkMode" = fetchurl { url = "https://github.com/NixOS/nixos-wiki-infra/releases/download/DarkMode-REL1_41-b2fefd2.tar.gz/DarkMode-REL1_41-b2fefd2.tar.gz"; sha256 = "1inbbqd25qacxmxjxl7rx153rapgk61433cs49cjmwcdx62w4vsj"; };
|
"DarkMode" = fetchzip { url = "https://github.com/NixOS/nixos-wiki-infra/releases/download/DarkMode-REL1_41-b2fefd2.tar.gz/DarkMode-REL1_41-b2fefd2.tar.gz"; sha256 = "0v3jyd2da18mbf0kn4zafw7rpj8awsiljy9jfhabric9k09g57y3"; };
|
||||||
}
|
}
|
@ -67,17 +67,17 @@ def mirror_extension(extension_name: str, mediawiki_version: str) -> Extension:
|
|||||||
with TemporaryDirectory() as tmpdir:
|
with TemporaryDirectory() as tmpdir:
|
||||||
download_file(download_url.geturl(), f"{tmpdir}/{base_name}")
|
download_file(download_url.geturl(), f"{tmpdir}/{base_name}")
|
||||||
run(["gh", "release", "upload", base_name, f"{tmpdir}/{base_name}"])
|
run(["gh", "release", "upload", base_name, f"{tmpdir}/{base_name}"])
|
||||||
hash = run(["nix-prefetch-url", mirror_url], stdout=subprocess.PIPE).stdout.strip()
|
hash = run(["nix-prefetch-url", "--unpack", mirror_url], stdout=subprocess.PIPE).stdout.strip()
|
||||||
return Extension(name=extension_name, hash=hash, url=mirror_url)
|
return Extension(name=extension_name, hash=hash, url=mirror_url)
|
||||||
|
|
||||||
|
|
||||||
def write_nix_file(file: IO[str], mirrored_extensions: list[Extension]) -> None:
|
def write_nix_file(file: IO[str], mirrored_extensions: list[Extension]) -> None:
|
||||||
file.write("{ fetchurl }: {\n")
|
file.write("{ fetchzip }: {\n")
|
||||||
for extension in mirrored_extensions:
|
for extension in mirrored_extensions:
|
||||||
file.write(
|
file.write(
|
||||||
f' "{extension.name}" = fetchurl {{ url = "{extension.url}"; sha256 = "{extension.hash}"; }};\n'
|
f' "{extension.name}" = fetchzip {{ url = "{extension.url}"; sha256 = "{extension.hash}"; }};\n'
|
||||||
)
|
)
|
||||||
file.write("}")
|
file.write("}\n")
|
||||||
|
|
||||||
|
|
||||||
def get_mediawiki_version(mediawiki_version: str | None = None) -> str:
|
def get_mediawiki_version(mediawiki_version: str | None = None) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user