Merge pull request #284109 from ambroisie/update-woodpecker

woodpecker-*: 1.0.5 -> 2.2.2
This commit is contained in:
Adam C. Stephens 2024-01-28 10:19:02 -05:00 committed by GitHub
commit 382935bf7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 17 additions and 3396 deletions

View File

@ -112,6 +112,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
release notes of [v19](https://github.com/systemd/mkosi/releases/tag/v19) and
[v20](https://github.com/systemd/mkosi/releases/tag/v20) for a list of changes.
- The `woodpecker-*` packages have been updated to v2 which includes [breaking changes](https://woodpecker-ci.org/docs/next/migrations#200).
- `services.nginx` will no longer advertise HTTP/3 availability automatically. This must now be manually added, preferably to each location block.
Example:

View File

@ -1,18 +1,17 @@
{ lib, fetchFromGitHub }:
{ lib, fetchzip }:
let
version = "1.0.5";
srcHash = "sha256-tkgkhYuLHfmT42P+UMZ7uNB2wBKo0YGiw0a5RoMAu6M=";
vendorHash = "sha256-QTTnTPOgP+FlbqXNCGJc9VuBzQcMujpvFB3+DykYTPY=";
yarnHash = "sha256-TrcTc5svLLSedRC8gCwIBW7/mtHo+uSNZGImtRiVJ0w=";
version = "2.2.2";
srcHash = "sha256-Ld75U7ItpBgoLKPLNQF0Kb5PFg2O5vdm26aNs/HYfcw=";
# The tarball contains vendored dependencies
vendorHash = null;
in
{
inherit version yarnHash vendorHash;
inherit version vendorHash;
src = fetchFromGitHub {
owner = "woodpecker-ci";
repo = "woodpecker";
rev = "v${version}";
src = fetchzip {
url = "https://github.com/woodpecker-ci/woodpecker/releases/download/v${version}/woodpecker-src.tar.gz";
hash = srcHash;
stripRoot = false;
};
postInstall = ''
@ -26,7 +25,7 @@ in
ldflags = [
"-s"
"-w"
"-X github.com/woodpecker-ci/woodpecker/version.Version=${version}"
"-X go.woodpecker-ci.org/woodpecker/v2/version.Version=${version}"
];
meta = with lib; {

View File

@ -1,57 +0,0 @@
{ lib, buildPackages, callPackage, fetchFromGitHub, fetchYarnDeps, mkYarnPackage }:
let
common = callPackage ./common.nix { };
esbuild_0_17_19 = buildPackages.esbuild.overrideAttrs (_: rec {
version = "0.17.19";
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-PLC7OJLSOiDq4OjvrdfCawZPfbfuZix4Waopzrj8qsU=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
});
in
mkYarnPackage {
pname = "woodpecker-frontend";
inherit (common) version;
src = "${common.src}/web";
packageJSON = ./woodpecker-package.json;
yarnLock = ./yarn.lock;
offlineCache = fetchYarnDeps {
yarnLock = ./yarn.lock;
hash = common.yarnHash;
};
ESBUILD_BINARY_PATH = lib.getExe esbuild_0_17_19;
buildPhase = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -R deps/woodpecker-ci/dist $out
echo "${common.version}" > "$out/version"
runHook postInstall
'';
# Do not attempt generating a tarball for woodpecker-frontend again.
doDist = false;
meta = common.meta // {
description = "Woodpecker Continuous Integration server frontend";
};
}

View File

@ -1,4 +1,4 @@
{ buildGoModule, callPackage, woodpecker-frontend }:
{ buildGoModule, callPackage }:
let
common = callPackage ./common.nix { };
in
@ -6,17 +6,11 @@ buildGoModule {
pname = "woodpecker-server";
inherit (common) version src ldflags postInstall vendorHash;
postPatch = ''
cp -r ${woodpecker-frontend} web/dist
'';
subPackages = "cmd/server";
CGO_ENABLED = 1;
passthru = {
inherit woodpecker-frontend;
updateScript = ./update.sh;
};

View File

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq nix-prefetch pnpm-lock-export
#!nix-shell -i bash -p nix wget jq nix-prefetch
# shellcheck shell=bash
@ -26,28 +26,9 @@ fi
# strip leading "v"
version="${version#v}"
sed -i -E -e "s#version = \".*\"#version = \"$version\"#" common.nix
# Woodpecker repository
src_hash=$(nix-prefetch-github woodpecker-ci woodpecker --rev "v${version}" | jq -r .hash)
# Go modules
vendorHash=$(nix-prefetch '{ sha256 }: (callPackage (import ./cli.nix) { }).goModules.overrideAttrs (_: { modHash = sha256; })')
# Front-end dependencies
woodpecker_src="https://raw.githubusercontent.com/woodpecker-ci/woodpecker/v$version"
wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/package.json" -O woodpecker-package.json
trap 'rm -rf pnpm-lock.yaml' EXIT
wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/pnpm-lock.yaml"
pnpm-lock-export --schema yarn.lock@v1
yarn_hash=$(prefetch-yarn-deps yarn.lock)
# Use friendlier hashes
src_hash=$(nix-prefetch-url --type sha256 --unpack "https://github.com/woodpecker-ci/woodpecker/releases/download/v$version/woodpecker-src.tar.gz")
src_hash=$(nix hash to-sri --type sha256 "$src_hash")
vendorHash=$(nix hash to-sri --type sha256 "$vendorHash")
yarn_hash=$(nix hash to-sri --type sha256 "$yarn_hash")
sed -i -E -e "s#version = \".*\"#version = \"$version\"#" common.nix
sed -i -E -e "s#srcHash = \".*\"#srcHash = \"$src_hash\"#" common.nix
sed -i -E -e "s#vendorHash = \".*\"#vendorHash = \"$vendorHash\"#" common.nix
sed -i -E -e "s#yarnHash = \".*\"#yarnHash = \"$yarn_hash\"#" common.nix

View File

@ -1,77 +0,0 @@
{
"name": "woodpecker-ci",
"author": "Woodpecker CI",
"version": "0.0.0",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
},
"scripts": {
"start": "vite",
"build": "vite build --base=/BASE_PATH",
"serve": "vite preview",
"lint": "eslint --max-warnings 0 --ext .js,.ts,.vue,.json .",
"formatcheck": "prettier -c .",
"format:fix": "prettier --write .",
"typecheck": "vue-tsc --noEmit",
"test": "echo 'No tests configured' && exit 0"
},
"dependencies": {
"@intlify/unplugin-vue-i18n": "^0.10.1",
"@kyvg/vue3-notification": "^2.9.1",
"@vueuse/core": "^9.13.0",
"ansi_up": "^5.2.1",
"dayjs": "^1.11.9",
"floating-vue": "^2.0.0-beta.24",
"fuse.js": "^6.6.2",
"humanize-duration": "^3.28.0",
"javascript-time-ago": "^2.5.9",
"lodash": "^4.17.21",
"node-emoji": "^1.11.0",
"pinia": "^2.1.4",
"prismjs": "^1.29.0",
"vue": "^3.3.4",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.2"
},
"devDependencies": {
"@iconify/json": "^2.2.85",
"@types/humanize-duration": "^3.27.1",
"@types/javascript-time-ago": "^2.0.3",
"@types/lodash": "^4.14.195",
"@types/node": "^18.16.19",
"@types/node-emoji": "^1.8.2",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/compiler-sfc": "^3.3.4",
"eslint": "^8.44.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.15.1",
"eslint-plugin-vue-scoped-css": "^2.5.0",
"prettier": "^2.8.8",
"typescript": "5.0.3",
"unplugin-icons": "^0.16.3",
"unplugin-vue-components": "^0.24.1",
"vite": "^4.3.9",
"vite-plugin-prismjs": "^0.0.8",
"vite-plugin-windicss": "^1.9.0",
"vite-svg-loader": "^4.0.0",
"vue-eslint-parser": "^9.3.1",
"vue-tsc": "^1.8.3",
"windicss": "^3.5.6"
},
"pnpm": {
"overrides": {
"semver@<7.5.2": ">=7.5.2",
"postcss@<8.4.31": ">=8.4.31"
}
}
}

View File

@ -14607,9 +14607,7 @@ with pkgs;
woodpecker-plugin-git = callPackage ../development/tools/continuous-integration/woodpecker-plugin-git { };
woodpecker-server = callPackage ../development/tools/continuous-integration/woodpecker/server.nix {
woodpecker-frontend = callPackage ../development/tools/continuous-integration/woodpecker/frontend.nix { };
};
woodpecker-server = callPackage ../development/tools/continuous-integration/woodpecker/server.nix { };
woof = callPackage ../tools/misc/woof { };