Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a44aef5381 |
Vendored
+9
-28
@@ -1,5 +1,5 @@
|
||||
# FleetDM Stack - Gitea Actions
|
||||
# CI: lint on every push
|
||||
# CI: lint on every push (skips docs-only changes)
|
||||
# Semantic Release: auto-bump version on push to main/master
|
||||
# - merge from feature/* branch → major bump
|
||||
# - any other commit (fix, chore, etc.) → patch bump
|
||||
@@ -12,6 +12,14 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
- 'STATUS.md'
|
||||
- 'AGENTS.md'
|
||||
- 'TASKS.md'
|
||||
- '.gitignore'
|
||||
- 'djinni-*/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
@@ -51,24 +59,7 @@ jobs:
|
||||
git clone https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git .
|
||||
git fetch --tags
|
||||
|
||||
- name: Check if release-worthy changes
|
||||
id: changes
|
||||
run: |
|
||||
CHANGED=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || git diff --name-only HEAD)
|
||||
echo "Changed files:"
|
||||
echo "$CHANGED"
|
||||
# Skip release if only docs, markdown, or non-chart files changed
|
||||
RELEASE_FILES=$(echo "$CHANGED" | grep -vE '^(docs/|README\.md|STATUS\.md|AGENTS\.md|TASKS\.md|\.gitignore|djinni-)' || true)
|
||||
if [ -z "$RELEASE_FILES" ]; then
|
||||
echo "Only docs/meta files changed — skipping release."
|
||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Chart/workflow files changed — proceeding with release."
|
||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Determine version bump
|
||||
if: steps.changes.outputs.skip != 'true'
|
||||
id: version
|
||||
run: |
|
||||
LATEST_TAG=$(git tag -l 'v*' --sort=-v:refname | head -1)
|
||||
@@ -77,13 +68,11 @@ jobs:
|
||||
fi
|
||||
echo "Latest tag: $LATEST_TAG"
|
||||
|
||||
# Strip 'v' prefix and split
|
||||
VER="${LATEST_TAG#v}"
|
||||
MAJOR=$(echo "$VER" | cut -d. -f1)
|
||||
MINOR=$(echo "$VER" | cut -d. -f2)
|
||||
PATCH=$(echo "$VER" | cut -d. -f3)
|
||||
|
||||
# Check if this commit is a merge from a feature/* branch
|
||||
COMMIT_MSG=$(git log -1 --format='%s' ${{ gitea.sha }})
|
||||
echo "Commit message: $COMMIT_MSG"
|
||||
|
||||
@@ -91,7 +80,6 @@ jobs:
|
||||
if echo "$COMMIT_MSG" | grep -qiE "^Merge.*feature/"; then
|
||||
IS_FEATURE="true"
|
||||
fi
|
||||
# Also check parent branches for merge commits
|
||||
if git log -1 --format='%P' ${{ gitea.sha }} | grep -q ' '; then
|
||||
MERGE_BRANCH=$(git log -1 --format='%s' ${{ gitea.sha }} | grep -oE "feature/[^ '\"]*" || true)
|
||||
if [ -n "$MERGE_BRANCH" ]; then
|
||||
@@ -116,19 +104,16 @@ jobs:
|
||||
echo "bump_type=${BUMP}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install Helm
|
||||
if: steps.changes.outputs.skip != 'true'
|
||||
run: |
|
||||
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
|
||||
- name: Update Chart.yaml version
|
||||
if: steps.changes.outputs.skip != 'true'
|
||||
run: |
|
||||
sed -i "s/^version: .*/version: ${{ steps.version.outputs.new_version }}/" fleetdm-stack/Chart.yaml
|
||||
echo "Chart.yaml version set to ${{ steps.version.outputs.new_version }}"
|
||||
grep '^version:' fleetdm-stack/Chart.yaml
|
||||
|
||||
- name: Package chart
|
||||
if: steps.changes.outputs.skip != 'true'
|
||||
run: |
|
||||
helm dependency update fleetdm-stack/
|
||||
helm package fleetdm-stack/
|
||||
@@ -137,7 +122,6 @@ jobs:
|
||||
ls -la .tmp/
|
||||
|
||||
- name: Create tag
|
||||
if: steps.changes.outputs.skip != 'true'
|
||||
run: |
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@git.produktor.io"
|
||||
@@ -145,14 +129,12 @@ jobs:
|
||||
git push https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git "${{ steps.version.outputs.new_tag }}"
|
||||
|
||||
- name: Create Gitea Release
|
||||
if: steps.changes.outputs.skip != 'true'
|
||||
run: |
|
||||
TAG="${{ steps.version.outputs.new_tag }}"
|
||||
BUMP="${{ steps.version.outputs.bump_type }}"
|
||||
API="https://git.produktor.io/api/v1/repos/${{ gitea.repository }}/releases"
|
||||
TOKEN="${{ gitea.token }}"
|
||||
|
||||
# Create release
|
||||
RELEASE=$(curl -sf -X POST "$API" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
@@ -160,7 +142,6 @@ jobs:
|
||||
RELEASE_ID=$(echo "$RELEASE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
echo "Created release ID: $RELEASE_ID"
|
||||
|
||||
# Upload chart package
|
||||
for f in .tmp/*.tgz; do
|
||||
FNAME=$(basename "$f")
|
||||
curl -sf -X POST "$API/$RELEASE_ID/assets?name=$FNAME" \
|
||||
|
||||
Reference in New Issue
Block a user