feat: add Woodpecker CI pipelines from CLI
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
5c0dd15f64
commit
3e630139ad
2 changed files with 73 additions and 0 deletions
52
.woodpecker/bugseti.yml
Normal file
52
.woodpecker/bugseti.yml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
when:
|
||||
- event: tag
|
||||
ref: "refs/tags/bugseti-v*"
|
||||
- event: push
|
||||
branch: main
|
||||
path: "cmd/bugseti/**"
|
||||
|
||||
steps:
|
||||
- name: frontend
|
||||
image: node:22-bookworm
|
||||
commands:
|
||||
- cd cmd/bugseti/frontend
|
||||
- npm ci --prefer-offline
|
||||
- npm run build
|
||||
|
||||
- name: build-linux
|
||||
image: golang:1.25-bookworm
|
||||
environment:
|
||||
CGO_ENABLED: "1"
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
commands:
|
||||
- apt-get update -qq && apt-get install -y -qq libgtk-3-dev libwebkit2gtk-4.1-dev > /dev/null 2>&1
|
||||
- cd cmd/bugseti
|
||||
- go build -tags production -trimpath -buildvcs=false -ldflags="-w -s" -o ../../bin/bugseti
|
||||
depends_on: [frontend]
|
||||
|
||||
- name: package
|
||||
image: alpine:3.21
|
||||
commands:
|
||||
- cd bin
|
||||
- tar czf bugseti-linux-amd64.tar.gz bugseti
|
||||
- sha256sum bugseti-linux-amd64.tar.gz > bugseti-linux-amd64.tar.gz.sha256
|
||||
- echo "=== Package ==="
|
||||
- ls -lh bugseti-linux-amd64.*
|
||||
- cat bugseti-linux-amd64.tar.gz.sha256
|
||||
depends_on: [build-linux]
|
||||
|
||||
- name: release
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: forgejo_token
|
||||
base_url: https://forge.lthn.io
|
||||
files:
|
||||
- bin/bugseti-linux-amd64.tar.gz
|
||||
- bin/bugseti-linux-amd64.tar.gz.sha256
|
||||
title: ${CI_COMMIT_TAG}
|
||||
note: "BugSETI ${CI_COMMIT_TAG} — Linux amd64 build"
|
||||
when:
|
||||
- event: tag
|
||||
depends_on: [package]
|
||||
21
.woodpecker/core.yml
Normal file
21
.woodpecker/core.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
when:
|
||||
- event: [push, pull_request, manual]
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: golang:1.25-bookworm
|
||||
commands:
|
||||
- go version
|
||||
- go mod download
|
||||
- >-
|
||||
go build
|
||||
-ldflags "-X forge.lthn.ai/core/cli/pkg/cli.AppVersion=ci
|
||||
-X forge.lthn.ai/core/cli/pkg/cli.BuildCommit=${CI_COMMIT_SHA:0:7}
|
||||
-X forge.lthn.ai/core/cli/pkg/cli.BuildDate=$(date -u +%Y%m%d)"
|
||||
-o ./bin/core .
|
||||
- ./bin/core --version
|
||||
|
||||
- name: test
|
||||
image: golang:1.25-bookworm
|
||||
commands:
|
||||
- go test -short -count=1 -timeout 120s ./...
|
||||
Loading…
Add table
Reference in a new issue