did stuff
This commit is contained in:
parent
3f2346b201
commit
ee02c74250
10 changed files with 1511 additions and 0 deletions
130
.forgejo/workflows/ci.yml
Normal file
130
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
---
|
||||
name: Debian Forge CLI CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.25"
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
|
||||
jobs:
|
||||
build-and-package:
|
||||
name: Build and Package CLI
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: golang:1.25-bullseye
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go environment
|
||||
run: |
|
||||
go version
|
||||
go env
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
devscripts \
|
||||
debhelper \
|
||||
dh-golang \
|
||||
golang-go \
|
||||
git \
|
||||
ca-certificates
|
||||
|
||||
- name: Download Go modules
|
||||
run: go mod download
|
||||
|
||||
- name: Build CLI
|
||||
run: |
|
||||
go build -o debian-forge-cli ./cmd/image-builder
|
||||
chmod +x debian-forge-cli
|
||||
|
||||
- name: Create debian directory
|
||||
run: |
|
||||
mkdir -p debian
|
||||
cat > debian/control << EOF
|
||||
Source: debian-forge-cli
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Debian Forge Team <team@debian-forge.org>
|
||||
Build-Depends: debhelper (>= 13), dh-golang, golang-go, git, ca-certificates
|
||||
Standards-Version: 4.6.2
|
||||
|
||||
Package: debian-forge-cli
|
||||
Architecture: any
|
||||
Depends: \${shlibs:Depends}, \${misc:Depends}
|
||||
Description: Debian Forge Command Line Interface
|
||||
Debian Forge CLI provides command-line tools for building
|
||||
Debian atomic images and managing blueprints.
|
||||
EOF
|
||||
|
||||
cat > debian/rules << EOF
|
||||
#!/usr/bin/make -f
|
||||
%:
|
||||
dh \$@
|
||||
|
||||
override_dh_auto_install:
|
||||
dh_auto_install
|
||||
mkdir -p debian/debian-forge-cli/usr/bin
|
||||
cp debian-forge-cli debian/debian-forge-cli/usr/bin/
|
||||
EOF
|
||||
|
||||
cat > debian/changelog << EOF
|
||||
debian-forge-cli (1.0.0-1) unstable; urgency=medium
|
||||
|
||||
* Initial release
|
||||
* Debian Forge CLI implementation
|
||||
|
||||
-- Debian Forge Team <team@debian-forge.org> $(date -R)
|
||||
EOF
|
||||
|
||||
cat > debian/compat << EOF
|
||||
13
|
||||
EOF
|
||||
|
||||
chmod +x debian/rules
|
||||
|
||||
- name: Build Debian package
|
||||
run: |
|
||||
dpkg-buildpackage -us -uc -b
|
||||
ls -la ../*.deb
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: debian-forge-cli-deb
|
||||
path: ../*.deb
|
||||
retention-days: 30
|
||||
|
||||
test:
|
||||
name: Test CLI
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: golang:1.25-bullseye
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go environment
|
||||
run: go version
|
||||
|
||||
- name: Download Go modules
|
||||
run: go mod download
|
||||
|
||||
- name: Run tests
|
||||
run: go test ./...
|
||||
|
||||
- name: Test CLI help
|
||||
run: |
|
||||
go build -o debian-forge-cli ./cmd/image-builder
|
||||
./debian-forge-cli --help || echo "Help command not implemented yet"
|
||||
Loading…
Add table
Add a link
Reference in a new issue