-
Notifications
You must be signed in to change notification settings - Fork 2
chore: enable Renovate and alauda auto-release for harbor-cli #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5b8ce46
2fbf8b2
34f0fb8
1c73535
8e9a905
684ac6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Auto Tag for Alauda | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'alauda-v*' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| tag: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - 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.0.18 | ||
|
|
||
| VERSION_NO_V="${BASE_VERSION#v}" # 0.0.18 | ||
| MAJOR=$(echo "$VERSION_NO_V" | cut -d. -f1) | ||
| MINOR=$(echo "$VERSION_NO_V" | cut -d. -f2) | ||
| PATCH=$(echo "$VERSION_NO_V" | cut -d. -f3) | ||
|
|
||
| NEXT_PATCH=$((PATCH + 1)) | ||
| NEXT_VERSION="v${MAJOR}.${MINOR}.${NEXT_PATCH}" # v0.0.19 | ||
|
|
||
| TAG_PREFIX="${NEXT_VERSION}-${PREFIX}" # v0.0.19-alauda | ||
| echo "TAG_PREFIX=$TAG_PREFIX" | ||
|
|
||
| echo "tag_prefix=$TAG_PREFIX" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Find latest tag with this prefix | ||
| id: latest | ||
| run: | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Info ( |
||
| 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 }}" | ||
| echo "Creating tag: $NEW_TAG" | ||
| git tag "$NEW_TAG" | ||
| git push origin "$NEW_TAG" | ||
|
|
||
| release: | ||
| name: Release Alauda | ||
| needs: [tag] | ||
| uses: ./.github/workflows/release-alauda.yml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Release Alauda | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*-alauda-*" | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| release: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warning ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warning ( |
||
| name: alauda-release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warning ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warning ( |
||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Dagger Version | ||
| id: dagger_version | ||
| uses: sagikazarmark/dagger-version-action@v0.0.1 | ||
|
|
||
| - name: Create Build Dir | ||
| run: mkdir -p dist | ||
|
|
||
| - name: Build Binaries | ||
| uses: dagger/dagger-for-github@v7 | ||
| with: | ||
| version: ${{ steps.dagger_version.outputs.version }} | ||
| verb: call | ||
| args: "build --build-dir=./dist export --path=./dist" | ||
|
|
||
| - name: Archive Binaries | ||
| uses: dagger/dagger-for-github@v7 | ||
| with: | ||
| version: ${{ steps.dagger_version.outputs.version }} | ||
| verb: call | ||
| args: "archive --build-dir=./dist export --path=./dist" | ||
|
|
||
| - name: Create Checksum | ||
| uses: dagger/dagger-for-github@v7 | ||
| with: | ||
| version: ${{ steps.dagger_version.outputs.version }} | ||
| verb: call | ||
| args: "checksum --build-dir=./dist export --path=./dist" | ||
|
|
||
| - name: Publish Release | ||
| uses: dagger/dagger-for-github@v7 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| version: ${{ steps.dagger_version.outputs.version }} | ||
| verb: call | ||
| args: "publish-release --build-dir=./dist --token=env://GITHUB_TOKEN" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module github.com/goharbor/harbor-cli | ||
|
|
||
| go 1.24.8 | ||
| go 1.26.2 | ||
|
|
||
| require ( | ||
| github.com/atotto/clipboard v0.1.4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": ["github>AlaudaDevops/renovate-config:base"], | ||
| "baseBranches": ["/^alauda-v.*/"], | ||
| "postUpdateOptions": ["gomodTidy"], | ||
| "assignees": ["chengjingtao"] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Info (
style/robustness): The tag extraction logic uses bash string manipulation. Consider adding validation to handle malformed branch names gracefully.