ci: Jenkins pipeline and tests for packaging/release tools
ysj7705/mudfish-decky/pipeline/head There was a failure building this commit
ysj7705/mudfish-decky/pipeline/head There was a failure building this commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f33bc0a49f
commit
c2841e8f21
3 files changed
+205
No files matched your search
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
def isMain() {
|
||||
def branch = env.BRANCH_NAME ?: env.GIT_BRANCH ?: ''
|
||||
return !env.CHANGE_ID && branch in ['main', 'origin/main', 'refs/heads/main']
|
||||
}
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
GITEA_URL = 'https://git.sejong.dev'
|
||||
GITEA_REPO = 'ysj7705/mudfish-decky'
|
||||
// Secret text credential: a Gitea access token allowed to write this repository's releases.
|
||||
GITEA_CREDENTIALS_ID = 'gitea-release-token'
|
||||
PYTHON_IMAGE = 'python:3.14-slim'
|
||||
NODE_IMAGE = 'node:22-bookworm'
|
||||
PNPM = 'npx -y pnpm@9.15.9'
|
||||
}
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
disableConcurrentBuilds()
|
||||
buildDiscarder(logRotator(numToKeepStr: '20'))
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Test') {
|
||||
steps {
|
||||
sh 'sh scripts/ci-run.sh "$PYTHON_IMAGE" sh -c "PYTHONPATH=py_modules python -m unittest discover -s tests -t . -v"'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'sh scripts/ci-run.sh "$NODE_IMAGE" sh -c "$PNPM install --frozen-lockfile && $PNPM build"'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Package') {
|
||||
steps {
|
||||
sh 'rm -rf out && sh scripts/ci-run.sh "$PYTHON_IMAGE" python scripts/package.py out'
|
||||
archiveArtifacts artifacts: 'out/*.zip', fingerprint: true
|
||||
}
|
||||
}
|
||||
|
||||
stage('Release') {
|
||||
// A release is published once per package.json version: bump the version on main to ship.
|
||||
when { expression { isMain() } }
|
||||
steps {
|
||||
withCredentials([string(credentialsId: env.GITEA_CREDENTIALS_ID, variable: 'GITEA_TOKEN')]) {
|
||||
sh 'sh scripts/ci-run.sh "$PYTHON_IMAGE" python scripts/gitea_release.py out'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user