Skip to content

Commit a26057a

Browse files
nightly release with gh actions
1 parent 8857e11 commit a26057a

File tree

10 files changed

+1916
-1
lines changed

10 files changed

+1916
-1
lines changed

.github/workflows/nightly-release.yaml

Lines changed: 616 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,84 @@
1111
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
1212
[![Go Report Card](https://goreportcard.com/badge/tektoncd/pipeline)](https://goreportcard.com/report/tektoncd/pipeline)
1313
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4020/badge)](https://bestpractices.coreinfrastructure.org/projects/4020)
14+
[![Nightly Release](https://img.shields.io/badge/Nightly-Release-blue?logo=github)](docs/nightly-releases.md)
15+
16+
The Tekton Pipelines project provides k8s-style resources for declaring
17+
CI/CD-style pipelines.
18+
19+
## 🚀 Quick Start
20+
21+
### For Users
22+
- [Installing Tekton Pipelines](docs/install.md)
23+
- [Getting Started Tutorial](https://tekton.dev/docs/getting-started/tasks/)
24+
- [Browse Examples](examples/)
25+
26+
### For Contributors & Fork Maintainers
27+
- [Contributing Guide](CONTRIBUTING.md)
28+
- [Development Setup](DEVELOPMENT.md)
29+
- **[🌙 Nightly Releases Setup](docs/nightly-releases.md)** - Complete guide for fork maintainers
30+
31+
---
32+
33+
## 🌙 Nightly Releases
34+
35+
This repository supports automated nightly releases that build and publish development images for testing and early feedback. The nightly release system is designed to work with any fork of the Tekton Pipeline repository.
36+
37+
### 🚀 Quick Start for Fork Maintainers
38+
39+
Get started with nightly releases:
40+
41+
1. **Set up GitHub secrets**:
42+
- `GHCR_TOKEN`: GitHub Personal Access Token with `packages:write` scope
43+
- `GCS_SERVICE_ACCOUNT_KEY`: Google Cloud Service Account key for bucket access
44+
45+
2. **Enable the workflow** in your fork's Actions tab
46+
47+
3. **Test your setup**:
48+
```bash
49+
# Manual test run
50+
gh workflow run "Tekton Nightly Release"
51+
52+
# Check the run status
53+
gh run watch
54+
```
55+
56+
### ✨ Features
57+
58+
- 🔄 **Automated builds** every night at 03:00 UTC
59+
- 🏗️ **Multi-platform images** (amd64, arm64, s390x, ppc64le)
60+
- 🔍 **Basic validation** and health checks
61+
- 📦 **GitHub Container Registry** publishing
62+
- 🔧 **Fork-aware** with automatic configuration
63+
64+
### 📚 Documentation
65+
66+
| Document | Purpose |
67+
|----------|---------|
68+
| **[Setup Guide](docs/nightly-releases.md)** | Complete setup and configuration guide |
69+
| **[CI/CD Integration](docs/cicd-integration.md)** | Simple integration patterns for your workflow |
70+
71+
### 📊 What Gets Published
72+
73+
Nightly builds publish these container images to `ghcr.io/{your-username}/pipeline/`:
74+
75+
- `cmd/controller:nightly-YYYYMMDD` - Tekton Pipeline Controller
76+
- `cmd/webhook:nightly-YYYYMMDD` - Admission Webhook
77+
- `cmd/events:nightly-YYYYMMDD` - Event Handler
78+
- `cmd/resolvers:nightly-YYYYMMDD` - Bundle and Git Resolvers
79+
80+
All images are:
81+
- ✅ Multi-platform (linux/amd64, linux/arm64, linux/s390x, linux/ppc64le)
82+
- ✅ Tagged with date and commit SHA for traceability
83+
84+
### 📚 Related Resources
85+
86+
- **[Tekton Pipeline Documentation](https://tekton.dev/docs/pipelines/)**
87+
- **[GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry)**
88+
89+
For detailed setup instructions and troubleshooting, see **[docs/nightly-releases.md](docs/nightly-releases.md)**.
90+
91+
---
1492

1593
The Tekton Pipelines project provides k8s-style resources for declaring
1694
CI/CD-style pipelines.

bundle-resolver-config.md

Whitespace-only changes.

docs/cicd-integration.md

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# CI/CD Integration Guide for Tekton Nightly Releases
2+
3+
This guide provides simple patterns for integrating nightly releases into your existing CI/CD workflow.
4+
5+
## Overview
6+
7+
Nightly releases run independently and publish container images to `ghcr.io/{owner}/pipeline/`. You can integrate these into your workflow in a few simple ways:
8+
9+
- **Independent**: Nightly builds run on their own schedule (03:00 UTC)
10+
- **Tested**: Each build includes basic validation before publishing
11+
- **Available**: Images are published to GitHub Container Registry
12+
13+
## Integration Patterns
14+
15+
### Pattern 1: Use Nightly Images in Testing
16+
17+
Test your applications against the latest nightly build:
18+
19+
```yaml
20+
name: Test with Nightly Tekton
21+
on:
22+
schedule:
23+
- cron: '0 6 * * *' # Run after nightly build
24+
25+
jobs:
26+
test:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Install Latest Nightly
32+
run: |
33+
# Install the latest nightly release
34+
kubectl apply -f https://storage.googleapis.com/tekton-releases-nightly/pipeline/nightly/latest/release.yaml
35+
36+
# Wait for it to be ready
37+
kubectl wait --for=condition=Available=True deployment/tekton-pipelines-controller -n tekton-pipelines --timeout=300s
38+
39+
- name: Run Your Tests
40+
run: |
41+
# Run your pipeline tests here
42+
echo "Testing with nightly Tekton..."
43+
```
44+
45+
### Pattern 2: Deploy to Staging After Successful Build
46+
47+
Automatically deploy successful nightly builds to staging:
48+
49+
```yaml
50+
name: Deploy Nightly to Staging
51+
on:
52+
workflow_run:
53+
workflows: ["Tekton Nightly Release"]
54+
types: [completed]
55+
56+
jobs:
57+
deploy:
58+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
59+
runs-on: ubuntu-latest
60+
environment: staging
61+
steps:
62+
- name: Deploy to Staging
63+
run: |
64+
# Configure kubectl for your staging cluster
65+
echo "${{ secrets.STAGING_KUBECONFIG }}" | base64 -d > $HOME/.kube/config
66+
67+
# Deploy the latest nightly
68+
kubectl apply -f https://storage.googleapis.com/tekton-releases-nightly/pipeline/nightly/latest/release.yaml
69+
70+
# Verify deployment
71+
kubectl wait --for=condition=Available=True deployment/tekton-pipelines-controller -n tekton-pipelines --timeout=300s
72+
echo "✅ Staging deployment complete"
73+
```
74+
75+
### Pattern 3: Quality Gates
76+
77+
Block releases if nightly builds are failing:
78+
79+
```yaml
80+
name: Release
81+
on:
82+
push:
83+
tags: ['v*']
84+
85+
jobs:
86+
check-nightly:
87+
runs-on: ubuntu-latest
88+
steps:
89+
- name: Check Recent Nightly Status
90+
env:
91+
GH_TOKEN: ${{ github.token }}
92+
run: |
93+
# Check last 3 nightly runs
94+
FAILED_RUNS=$(gh run list --workflow="Tekton Nightly Release" --limit=3 --json=conclusion --jq '[.[] | select(.conclusion == "failure")] | length')
95+
96+
if [ "$FAILED_RUNS" -ge 2 ]; then
97+
echo "❌ Multiple recent nightly failures - investigate before releasing"
98+
exit 1
99+
fi
100+
101+
echo "✅ Recent nightly builds are healthy"
102+
103+
release:
104+
needs: check-nightly
105+
runs-on: ubuntu-latest
106+
steps:
107+
- name: Proceed with Release
108+
run: echo "🚀 Releasing..."
109+
```
110+
111+
## Notifications
112+
113+
### Slack Notifications
114+
115+
Get notified when nightly builds fail:
116+
117+
```yaml
118+
name: Nightly Notifications
119+
on:
120+
workflow_run:
121+
workflows: ["Tekton Nightly Release"]
122+
types: [completed]
123+
124+
jobs:
125+
notify:
126+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
127+
runs-on: ubuntu-latest
128+
steps:
129+
- name: Notify Slack
130+
env:
131+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
132+
run: |
133+
curl -X POST -H 'Content-type: application/json' \
134+
--data "{\"text\":\"❌ Nightly Tekton build failed: ${{ github.event.workflow_run.html_url }}\"}" \
135+
"$SLACK_WEBHOOK"
136+
```
137+
138+
## Development Workflow
139+
140+
### Testing Changes Impact
141+
142+
Before merging changes that might affect nightly builds:
143+
144+
```bash
145+
# Test your changes don't break nightly builds
146+
gh workflow run "Tekton Nightly Release" --ref your-branch
147+
148+
# Wait and check the result
149+
gh run watch
150+
```
151+
152+
### Monitoring Nightly Health
153+
154+
Simple script to check nightly build health:
155+
156+
```bash
157+
#!/bin/bash
158+
# check-nightly-health.sh
159+
160+
RECENT_RUNS=$(gh run list --workflow="Tekton Nightly Release" --limit=5 --json=conclusion --jq '[.[] | select(.conclusion == "failure")] | length')
161+
162+
if [ "$RECENT_RUNS" -ge 3 ]; then
163+
echo "⚠️ Nightly builds need attention ($RECENT_RUNS recent failures)"
164+
exit 1
165+
else
166+
echo "✅ Nightly builds are healthy"
167+
fi
168+
```
169+
170+
## Troubleshooting
171+
172+
### Common Issues
173+
174+
1. **Wrong Workflow Name**
175+
```yaml
176+
# ❌ Wrong
177+
workflows: ["Tekton Nightly Release (Production Ready)"]
178+
179+
# ✅ Correct
180+
workflows: ["Tekton Nightly Release"]
181+
```
182+
183+
2. **Assuming Specific Dates**
184+
```bash
185+
# ❌ Wrong - assumes build happened today
186+
:nightly-$(date +%Y%m%d)
187+
188+
# ✅ Correct - use latest
189+
https://storage.googleapis.com/tekton-releases-nightly/pipeline/nightly/latest/release.yaml
190+
```
191+
192+
3. **Missing Error Handling**
193+
```bash
194+
# ❌ Wrong
195+
kubectl apply -f some-url
196+
197+
# ✅ Correct
198+
if ! kubectl apply -f some-url; then
199+
echo "Failed to apply"
200+
exit 1
201+
fi
202+
```
203+
204+
### Getting Help
205+
206+
- Check the nightly workflow logs in your repository's Actions tab
207+
- Look at recent runs to see if there's a pattern in failures
208+
- Issues are typically related to:
209+
- GitHub token permissions (`packages:write`, `contents:read`)
210+
- Container registry connectivity
211+
- Kubernetes version compatibility
212+
213+
---
214+
215+
This simplified integration approach focuses on practical, everyday use cases without unnecessary complexity. The nightly release system is designed to "just work" - these patterns help you make the most of it without overengineering.

0 commit comments

Comments
 (0)