Skip to content

Commit 75e03f4

Browse files
committed
Init release flux9s
Signed-off-by: Daniel Guns <danbguns@gmail.com>
0 parents  commit 75e03f4

61 files changed

Lines changed: 26158 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bump-version.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Bump Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'New version (e.g., 0.1.1)'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
bump-version:
13+
name: Bump Version
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Update version in Cargo.toml
21+
run: |
22+
VERSION="${{ inputs.version }}"
23+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
24+
echo "Updated version to $VERSION"
25+
26+
- name: Update CHANGELOG.md
27+
run: |
28+
VERSION="${{ inputs.version }}"
29+
DATE=$(date +%Y-%m-%d)
30+
# Create a temporary file with the new changelog entry
31+
cat > /tmp/changelog_entry.txt << EOF
32+
33+
## [$VERSION] - $DATE
34+
35+
### Added
36+
- TBD
37+
38+
### Changed
39+
- TBD
40+
41+
### Fixed
42+
- TBD
43+
EOF
44+
# Insert after the [Unreleased] line
45+
sed -i "/^## \[Unreleased\]/r /tmp/changelog_entry.txt" CHANGELOG.md
46+
echo "Updated CHANGELOG.md"
47+
48+
- name: Create Pull Request
49+
uses: peter-evans/create-pull-request@v5
50+
with:
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
commit-message: "chore: bump version to ${{ inputs.version }}"
53+
title: "chore: Bump version to ${{ inputs.version }}"
54+
body: |
55+
This PR bumps the version to ${{ inputs.version }}.
56+
57+
**Changes:**
58+
- Updated version in Cargo.toml
59+
- Updated CHANGELOG.md
60+
61+
**Next steps:**
62+
1. Review and merge this PR
63+
2. Create tag: `git tag v${{ inputs.version }}`
64+
3. Push tag: `git push origin main --tags`
65+
4. Release workflow will automatically publish to crates.io
66+
branch: bump-version-${{ inputs.version }}
67+
delete-branch: true
68+
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Check Flux CRD Updates
2+
3+
on:
4+
schedule:
5+
# Run every Monday at 9 AM UTC
6+
- cron: '0 9 * * 1'
7+
workflow_dispatch:
8+
9+
jobs:
10+
check-crd-updates:
11+
name: Check for Flux CRD Updates
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Install dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y curl jq
25+
26+
- name: Check latest Flux versions
27+
id: check_versions
28+
run: |
29+
echo "Checking latest Flux component versions..."
30+
31+
# Check source-controller
32+
SOURCE_VERSION=$(curl -s https://api.github.com/repos/fluxcd/source-controller/releases/latest | jq -r '.tag_name' | sed 's/v//')
33+
echo "source_controller_latest=$SOURCE_VERSION" >> $GITHUB_OUTPUT
34+
35+
# Check kustomize-controller
36+
KUSTOMIZE_VERSION=$(curl -s https://api.github.com/repos/fluxcd/kustomize-controller/releases/latest | jq -r '.tag_name' | sed 's/v//')
37+
echo "kustomize_controller_latest=$KUSTOMIZE_VERSION" >> $GITHUB_OUTPUT
38+
39+
# Check helm-controller
40+
HELM_VERSION=$(curl -s https://api.github.com/repos/fluxcd/helm-controller/releases/latest | jq -r '.tag_name' | sed 's/v//')
41+
echo "helm_controller_latest=$HELM_VERSION" >> $GITHUB_OUTPUT
42+
43+
# Check notification-controller
44+
NOTIFICATION_VERSION=$(curl -s https://api.github.com/repos/fluxcd/notification-controller/releases/latest | jq -r '.tag_name' | sed 's/v//')
45+
echo "notification_controller_latest=$NOTIFICATION_VERSION" >> $GITHUB_OUTPUT
46+
47+
# Check image-reflector-controller
48+
IMAGE_REFLECTOR_VERSION=$(curl -s https://api.github.com/repos/fluxcd/image-reflector-controller/releases/latest | jq -r '.tag_name' | sed 's/v//')
49+
echo "image_reflector_controller_latest=$IMAGE_REFLECTOR_VERSION" >> $GITHUB_OUTPUT
50+
51+
# Check image-automation-controller
52+
IMAGE_AUTOMATION_VERSION=$(curl -s https://api.github.com/repos/fluxcd/image-automation-controller/releases/latest | jq -r '.tag_name' | sed 's/v//')
53+
echo "image_automation_controller_latest=$IMAGE_AUTOMATION_VERSION" >> $GITHUB_OUTPUT
54+
55+
# Check source-watcher
56+
SOURCE_WATCHER_VERSION=$(curl -s https://api.github.com/repos/fluxcd/source-watcher/releases/latest | jq -r '.tag_name' | sed 's/v//')
57+
echo "source_watcher_latest=$SOURCE_WATCHER_VERSION" >> $GITHUB_OUTPUT
58+
59+
echo "Latest versions:"
60+
echo " source-controller: $SOURCE_VERSION"
61+
echo " kustomize-controller: $KUSTOMIZE_VERSION"
62+
echo " helm-controller: $HELM_VERSION"
63+
echo " notification-controller: $NOTIFICATION_VERSION"
64+
echo " image-reflector-controller: $IMAGE_REFLECTOR_VERSION"
65+
echo " image-automation-controller: $IMAGE_AUTOMATION_VERSION"
66+
echo " source-watcher: $SOURCE_WATCHER_VERSION"
67+
68+
- name: Download latest CRDs
69+
run: |
70+
mkdir -p crds_new
71+
72+
# Download source-controller CRDs
73+
curl -L "https://github.com/fluxcd/source-controller/releases/download/v${{ steps.check_versions.outputs.source_controller_latest }}/source-controller.crds.yaml" -o crds_new/source-controller.crds.yaml
74+
75+
# Download kustomize-controller CRDs
76+
curl -L "https://github.com/fluxcd/kustomize-controller/releases/download/v${{ steps.check_versions.outputs.kustomize_controller_latest }}/kustomize-controller.crds.yaml" -o crds_new/kustomize-controller.crds.yaml
77+
78+
# Download helm-controller CRDs
79+
curl -L "https://github.com/fluxcd/helm-controller/releases/download/v${{ steps.check_versions.outputs.helm_controller_latest }}/helm-controller.crds.yaml" -o crds_new/helm-controller.crds.yaml
80+
81+
# Download notification-controller CRDs
82+
curl -L "https://github.com/fluxcd/notification-controller/releases/download/v${{ steps.check_versions.outputs.notification_controller_latest }}/notification-controller.crds.yaml" -o crds_new/notification-controller.crds.yaml
83+
84+
# Download image-reflector-controller CRDs
85+
curl -L "https://github.com/fluxcd/image-reflector-controller/releases/download/v${{ steps.check_versions.outputs.image_reflector_controller_latest }}/image-reflector-controller.crds.yaml" -o crds_new/image-reflector-controller.crds.yaml
86+
87+
# Download image-automation-controller CRDs
88+
curl -L "https://github.com/fluxcd/image-automation-controller/releases/download/v${{ steps.check_versions.outputs.image_automation_controller_latest }}/image-automation-controller.crds.yaml" -o crds_new/image-automation-controller.crds.yaml
89+
90+
# Download source-watcher CRDs
91+
curl -L "https://github.com/fluxcd/source-watcher/releases/download/v${{ steps.check_versions.outputs.source_watcher_latest }}/source-watcher.crds.yaml" -o crds_new/source-watcher.crds.yaml
92+
93+
- name: Compare CRDs
94+
id: compare
95+
run: |
96+
CHANGED=false
97+
98+
for file in crds_new/*.yaml; do
99+
filename=$(basename "$file")
100+
if [ ! -f "crds/$filename" ] || ! diff -q "crds/$filename" "$file" > /dev/null 2>&1; then
101+
echo "CRD changed: $filename"
102+
CHANGED=true
103+
fi
104+
done
105+
106+
echo "changed=$CHANGED" >> $GITHUB_OUTPUT
107+
108+
- name: Install kopium
109+
if: steps.compare.outputs.changed == 'true'
110+
run: cargo install kopium
111+
112+
- name: Update CRDs and regenerate models
113+
if: steps.compare.outputs.changed == 'true'
114+
run: |
115+
# Backup current CRDs
116+
cp -r crds crds_backup
117+
118+
# Replace with new CRDs
119+
cp crds_new/*.yaml crds/
120+
121+
# Regenerate models
122+
# Note: This assumes you have a script or Makefile target for regeneration
123+
# Adjust based on your actual setup
124+
echo "Regenerating models..."
125+
# Add your model regeneration command here
126+
# Example: make regenerate-models
127+
128+
- name: Run tests
129+
if: steps.compare.outputs.changed == 'true'
130+
run: |
131+
cargo test --lib --tests --test crd_compatibility --test resource_registry --test model_compatibility
132+
133+
- name: Create Pull Request
134+
if: steps.compare.outputs.changed == 'true'
135+
uses: peter-evans/create-pull-request@v5
136+
with:
137+
token: ${{ secrets.GITHUB_TOKEN }}
138+
commit-message: |
139+
chore: update Flux CRDs to latest versions
140+
141+
- source-controller: v${{ steps.check_versions.outputs.source_controller_latest }}
142+
- kustomize-controller: v${{ steps.check_versions.outputs.kustomize_controller_latest }}
143+
- helm-controller: v${{ steps.check_versions.outputs.helm_controller_latest }}
144+
- notification-controller: v${{ steps.check_versions.outputs.notification_controller_latest }}
145+
- image-reflector-controller: v${{ steps.check_versions.outputs.image_reflector_controller_latest }}
146+
- image-automation-controller: v${{ steps.check_versions.outputs.image_automation_controller_latest }}
147+
- source-watcher: v${{ steps.check_versions.outputs.source_watcher_latest }}
148+
title: "chore: Update Flux CRDs to latest versions"
149+
body: |
150+
This PR updates Flux CRDs to the latest versions.
151+
152+
**Updated Components:**
153+
- source-controller: v${{ steps.check_versions.outputs.source_controller_latest }}
154+
- kustomize-controller: v${{ steps.check_versions.outputs.kustomize_controller_latest }}
155+
- helm-controller: v${{ steps.check_versions.outputs.helm_controller_latest }}
156+
- notification-controller: v${{ steps.check_versions.outputs.notification_controller_latest }}
157+
- image-reflector-controller: v${{ steps.check_versions.outputs.image_reflector_controller_latest }}
158+
- image-automation-controller: v${{ steps.check_versions.outputs.image_automation_controller_latest }}
159+
- source-watcher: v${{ steps.check_versions.outputs.source_watcher_latest }}
160+
161+
**Changes:**
162+
- Updated CRD files
163+
- Regenerated models with kopium
164+
- All tests passing
165+
166+
**Auto-generated by GitHub Actions**
167+
branch: update-flux-crds
168+
delete-branch: true

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Test Suite
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install Rust
17+
uses: dtolnay/rust-toolchain@stable
18+
with:
19+
components: rustfmt, clippy
20+
21+
- name: Cache cargo registry
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.cargo/bin/
26+
~/.cargo/registry/index/
27+
~/.cargo/registry/cache/
28+
~/.cargo/git/db/
29+
target/
30+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-cargo-
33+
34+
- name: Check formatting
35+
run: cargo fmt -- --check
36+
37+
- name: Run clippy
38+
run: cargo clippy --lib --tests -- -D warnings -A clippy::too_many_arguments -A clippy::items-after-test-module -A clippy::type-complexity -A clippy::should-implement-trait -A renamed_and_removed_lints -A clippy::collapsible-if -A clippy::len-zero -A clippy::assertions-on-constants -A dead-code
39+
40+
- name: Run tests
41+
run: cargo test --lib --tests
42+
43+
- name: Run integration tests
44+
run: cargo test --test crd_compatibility --test resource_registry --test model_compatibility --test field_extraction
45+
46+
build:
47+
name: Build
48+
runs-on: ${{ matrix.os }}
49+
strategy:
50+
matrix:
51+
os: [ubuntu-latest, macos-latest, windows-latest]
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Install Rust
56+
uses: dtolnay/rust-toolchain@stable
57+
58+
- name: Cache cargo registry
59+
uses: actions/cache@v4
60+
with:
61+
path: |
62+
~/.cargo/bin/
63+
~/.cargo/registry/index/
64+
~/.cargo/registry/cache/
65+
~/.cargo/git/db/
66+
target/
67+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
68+
restore-keys: |
69+
${{ runner.os }}-cargo-
70+
71+
- name: Build
72+
run: cargo build --release
73+
74+
- name: Upload artifacts
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: flux9s-${{ matrix.os }}
78+
path: target/release/flux9s*
79+

0 commit comments

Comments
 (0)