Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3cf1767
feat: init alauda-v4.47.1 branch (#3)
l-qing Aug 2, 2025
8344b67
chore(deps): update dependency go to v1.24.6 (#2)
alaudaa-renovate[bot] Aug 7, 2025
b488dba
fix: update scan-alauda workflow to scan alauda-yq binary (#4)
l-qing Aug 14, 2025
c463f85
chore(deps): update dependency go to v1.25.0 (#6)
alaudaa-renovate[bot] Aug 14, 2025
bb7fb2f
chore(deps): update golang docker tag to v1.24.6 (#7)
alaudaa-renovate[bot] Aug 18, 2025
1d02268
chore(deps): update all patch dependencies (#8)
alaudaa-renovate[bot] Sep 4, 2025
dcf97fe
chore(deps): update all patch dependencies (#9)
alaudaa-renovate[bot] Oct 8, 2025
a068008
chore(deps): update all patch dependencies (#10)
alaudaa-renovate[bot] Oct 14, 2025
281db1c
chore(deps): update all patch dependencies (#11)
alaudaa-renovate[bot] Nov 6, 2025
87eae22
chore(deps): update all patch dependencies (#12)
alaudaa-renovate[bot] Dec 2, 2025
1c729eb
chore(deps): update golang docker tag to v1.25.5 (#13)
alaudaa-renovate[bot] Dec 31, 2025
9e49e26
chore(deps): update golang docker tag to v1.25.6 (#14)
alaudaa-renovate[bot] Jan 16, 2026
792dcb8
chore(deps): update golang version to v1.25.6
l-qing Jan 30, 2026
5e87e9a
chore(deps): update golang docker tag to v1.25.7 (#15)
alaudaa-renovate[bot] Feb 5, 2026
7dbddaf
chore(deps): update golang version to v1.25.7
l-qing Feb 7, 2026
d89a90c
chore(deps): update golang docker tag to v1.26.0 (#17)
alaudaa-renovate[bot] Feb 12, 2026
75a0e86
chore(deps): update golang docker tag to v1.26.1 (#19)
alaudaa-renovate[bot] Mar 6, 2026
9933184
chore(deps): update golang version to v1.26.1
l-qing Mar 9, 2026
33e2170
chore(ci): update go version detection and devtools install
l-qing Mar 9, 2026
a7ad10c
chore: bump Go to 1.26.2
l-qing Apr 7, 2026
64cb2f4
chore(github): add workflow to sync releases to Nexus
l-qing May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/alauda-auto-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Auto Tag for Alauda

on:
push:
branches:
- 'alauda-v*'

permissions:
contents: write # create tags and releases
packages: write # upload packages

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all tags

- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Extract version and tag prefix
id: extract
run: |
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
echo "Branch: $BRANCH_NAME"

PREFIX="${BRANCH_NAME%%-*}" # alauda
BASE_VERSION="${BRANCH_NAME#${PREFIX}-}" # v0.62.1

VERSION_NO_V="${BASE_VERSION#v}" # 0.62.1
MAJOR=$(echo "$VERSION_NO_V" | cut -d. -f1)
MINOR=$(echo "$VERSION_NO_V" | cut -d. -f2)
PATCH=$(echo "$VERSION_NO_V" | cut -d. -f3)

echo "MAJOR: $MAJOR, MINOR: $MINOR, PATCH: $PATCH"

# PATCH + 1
NEXT_PATCH=$((PATCH + 1))
echo "NEXT_PATCH=$NEXT_PATCH"

NEXT_VERSION="v${MAJOR}.${MINOR}.${NEXT_PATCH}" # v0.62.2
echo "NEXT_VERSION=$NEXT_VERSION"

TAG_PREFIX="${NEXT_VERSION}-${PREFIX}" # v0.62.2-alauda
echo "TAG_PREFIX=$TAG_PREFIX"

echo "prefix=$PREFIX" >> $GITHUB_OUTPUT
echo "base_version=$BASE_VERSION" >> $GITHUB_OUTPUT
echo "tag_prefix=$TAG_PREFIX" >> $GITHUB_OUTPUT

- name: Find latest tag with this prefix
id: latest
run: |
TAG_PREFIX="${{ steps.extract.outputs.tag_prefix }}"
echo "Looking for tags with prefix: $TAG_PREFIX"

EXISTING_TAGS=$(git tag --list "${TAG_PREFIX}-*" | sort -V)
echo "Existing tags: $EXISTING_TAGS"

MAX_INDEX=-1
for tag in $EXISTING_TAGS; do
NUM=${tag##*-}
if [[ "$NUM" =~ ^[0-9]+$ && "$NUM" -gt "$MAX_INDEX" ]]; then
MAX_INDEX=$NUM
fi
done

NEW_INDEX=$((MAX_INDEX + 1))
NEW_TAG="${TAG_PREFIX}-${NEW_INDEX}"

echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT

- name: Create and push new tag
run: |
NEW_TAG="${{ steps.latest.outputs.new_tag }}"
git tag "$NEW_TAG"
git push origin "$NEW_TAG"

release-alauda:
name: Release Alauda
needs: [tag]
uses: ./.github/workflows/reusable-release-alauda.yaml
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.20'
go-version-file: go.mod
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Get dependencies
run: |
go get -v -t -d ./...
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/release-alauda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Alauda

on:
push:
tags:
- "v*-alauda-*"
workflow_dispatch:

permissions:
contents: write # create releases
packages: write # upload packages

jobs:
release-alauda:
name: Release Alauda
uses: ./.github/workflows/reusable-release-alauda.yaml
33 changes: 33 additions & 0 deletions .github/workflows/reusable-release-alauda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Alauda

on:
workflow_call:

permissions:
contents: write
packages: write

jobs:
release:
name: alauda-release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4.1.6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false

- name: Set up GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: v2.1.0
args: release -f=.goreleaser-alauda.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/scan-alauda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Scan vulnerabilities for Alauda
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
name: Scan Go vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.6

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: false

- name: Set up GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: v2.1.0
args: release --snapshot -f=.goreleaser-alauda.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.28.0
with:
scan-type: 'rootfs'
scan-ref: 'dist/yq_linux_amd64_v1/alauda-yq'
exit-code: 1
100 changes: 100 additions & 0 deletions .github/workflows/sync-to-nexus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Sync Release To Nexus

# Triggers a Tekton PipelineRun on the in-cluster ARC runner whenever an
# alauda-suffixed tag is pushed. The pipeline waits for the corresponding
# GitHub Release to be ready, then mirrors its assets to the internal
# Nexus under both a versioned path and a `latest/` channel.

on:
push:
tags:
- 'v*-alauda-*'

jobs:
trigger-sync:
# Base ARC runner image already bundles tkn / kubectl / curl / jq / yq;
# no `container:` override needed.
runs-on: alauda-devops-runner
steps:
- name: create PipelineRun and follow logs
env:
TEKTON_NS: devops
# Pipeline source: catalog "extras" via Tekton Hub resolver.
# Bump PIPELINE_VERSION together with catalog releases.
PIPELINE_CATALOG: extras
PIPELINE_NAME: sync-github-release-to-nexus
PIPELINE_VERSION: "0.1"
# Component-aware PipelineRun name so the run is identifiable
# at a glance in `kubectl get pipelinerun` listings:
# `sync-<repo>-<run_id>-<run_attempt>`. `github.event.repository.name`
# is just the repo without the owner (e.g. `yq`, `yq-private`,
# `trivy`, `cosign`, `chains`). `run_id` is globally unique;
# `run_attempt` disambiguates retries of the same run.
PR_NAME: sync-${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}
REPO: ${{ github.repository }}
# On `push: tags:` events, github.ref_name is the tag itself.
TAG: ${{ github.ref_name }}
RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}
run: |
set -euo pipefail

# Source-repo label uses dots instead of slashes to satisfy
# Kubernetes label value charset (no '/').
SOURCE_REPO_LABEL="${REPO//\//.}"

# Create PipelineRun with metadata.name (not generateName) so the
# PR name is known up front for `tkn pr logs -f` below.
# github-token workspace intentionally omitted: forks are public,
# pipeline declares it `optional: true` and falls back to anonymous.
cat <<EOF | kubectl create -f -
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: ${PR_NAME}
namespace: ${TEKTON_NS}
labels:
alauda.io/source-repo: ${SOURCE_REPO_LABEL}
alauda.io/source-tag: ${TAG}
alauda.io/triggered-by: github-actions
spec:
pipelineRef:
resolver: hub
params:
- { name: catalog, value: ${PIPELINE_CATALOG} }
- { name: type, value: tekton }
- { name: kind, value: pipeline }
- { name: name, value: ${PIPELINE_NAME} }
- { name: version, value: "${PIPELINE_VERSION}" }
params:
- { name: repo, value: ${REPO} }
- { name: tag, value: ${TAG} }
- { name: release-url, value: ${RELEASE_URL} }
workspaces:
- name: nexus-auth
secret:
secretName: build-nexus.kauto
# Shared scratch PVC across the 5 run-script tasks. emptyDir
# would be per-pod and cannot propagate downloaded assets +
# intermediate metadata across TaskRuns; volumeClaimTemplate
# makes Tekton create a PipelineRun-owned PVC reaped with
# the run. RWO is sufficient — the DAG is strictly linear.
- name: source
volumeClaimTemplate:
spec:
storageClassName: topolvm
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
EOF

# Stream logs until the PipelineRun completes; then surface the
# PipelineRun's Succeeded condition as the step exit code so the
# GitHub Actions UI reflects the real pipeline outcome.
tkn -n "${TEKTON_NS}" pr logs -f "${PR_NAME}"

STATUS=$(kubectl -n "${TEKTON_NS}" get pipelinerun "${PR_NAME}" \
-o jsonpath='{.status.conditions[?(@.type=="Succeeded")].status}')
echo "PipelineRun ${PR_NAME} final Succeeded status: ${STATUS}"
[ "${STATUS}" = "True" ]
58 changes: 58 additions & 0 deletions .goreleaser-alauda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy

builds:
- id: yq
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
ldflags:
- -w -s -extldflags '-static'
main: .
binary: alauda-yq

archives:
- id: archive
format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
footer: >-

---

This release is intended for use only as part of the Alauda product suite.
It is not recommended for use by individuals or teams outside of Alauda.
Any consequences arising from its use are the sole responsibility of the user.
Loading
Loading