Create custom CI pipeline
All checks were successful
ci/woodpecker/tag/build/1 Pipeline was successful
ci/woodpecker/release/build/1 Pipeline was successful
ci/woodpecker/release/build/2 Pipeline was successful
ci/woodpecker/release/manifest Pipeline was successful
ci/woodpecker/tag/build/2 Pipeline was successful
ci/woodpecker/tag/manifest Pipeline was successful

This commit is contained in:
2025-02-13 13:01:20 -08:00
parent d58228cd43
commit c194f4956d
6 changed files with 95 additions and 100 deletions

53
.woodpecker/build.yml Normal file
View File

@@ -0,0 +1,53 @@
matrix:
platform:
- linux/amd64
- linux/arm64
labels:
platform: ${platform}
steps:
- name: build
image: golang:1.23.6
commands:
- go build
when:
- event: tag
- name: docker
image: woodpeckerci/plugin-kaniko
settings:
registry: gitea.elara.ws
repo: elara6331/distrohop
tags: ${platform##linux/}
cache: true
username: elara6331
password:
from_secret: gitea_token
when:
event: tag
- name: nfpm
image: goreleaser/nfpm
environment:
ARCH: ${platform##linux/}
VERSION: ${CI_COMMIT_TAG##v}
commands:
- nfpm pkg -f .nfpm.yaml -p deb -t .
- nfpm pkg -f .nfpm.yaml -p rpm -t .
- nfpm pkg -f .nfpm.yaml -p archlinux -t .
when:
event: tag
- name: release
image: gitea.elara.ws/elara6331/woodpecker-release
settings:
title: "Version ${CI_COMMIT_TAG##v}"
files:
- '*.deb'
- '*.rpm'
- '*.tar.zst'
api_key:
from_secret: gitea_token
when:
event: tag

19
.woodpecker/manifest.yml Normal file
View File

@@ -0,0 +1,19 @@
labels:
platform: linux/amd64
steps:
- name: manifest
image: gcr.io/go-containerregistry/crane:debug
entrypoint: ["/busybox/sh", "-c", "echo $CI_SCRIPT | base64 -d | /busybox/sh -e"]
commands:
- crane auth login -u elara6331 -p $REGISTRY_TOKEN gitea.elara.ws
- crane index append -m gitea.elara.ws/elara6331/distrohop:amd64 -m gitea.elara.ws/elara6331/distrohop:arm64 -t gitea.elara.ws/elara6331/distrohop:latest
- crane index append -m gitea.elara.ws/elara6331/distrohop:amd64 -m gitea.elara.ws/elara6331/distrohop:arm64 -t gitea.elara.ws/elara6331/distrohop:${CI_COMMIT_TAG}
environment:
REGISTRY_TOKEN:
from_secret: gitea_token
when:
- event: tag
depends_on:
- build