Skip to content

Commit d30dfc5

Browse files
committed
feat(release): final release
Signed-off-by: Kleber Rocha <kleber.rocha@cora.com.br>
1 parent 54c74b6 commit d30dfc5

File tree

918 files changed

+21093
-23031
lines changed

Some content is hidden

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

918 files changed

+21093
-23031
lines changed

.github/dependabot.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
labels:
9+
- "dependencies"
10+
- "github-actions"
11+
12+
# Go modules - Backend
13+
- package-ecosystem: "gomod"
14+
directory: "/backend"
15+
schedule:
16+
interval: "weekly"
17+
labels:
18+
- "dependencies"
19+
- "go"
20+
- "backend"
21+
22+
# npm - Frontend
23+
- package-ecosystem: "npm"
24+
directory: "/frontend"
25+
schedule:
26+
interval: "weekly"
27+
labels:
28+
- "dependencies"
29+
- "npm"
30+
- "frontend"
31+
ignore:
32+
- dependency-name: "*"
33+
update-types: ["version-update:semver-major"]
34+
35+
# Docker - Backend
36+
- package-ecosystem: "docker"
37+
directory: "/backend"
38+
schedule:
39+
interval: "weekly"
40+
labels:
41+
- "dependencies"
42+
- "docker"
43+
- "backend"
44+
45+
# Docker - Frontend
46+
- package-ecosystem: "docker"
47+
directory: "/frontend"
48+
schedule:
49+
interval: "weekly"
50+
labels:
51+
- "dependencies"
52+
- "docker"
53+
- "frontend"

.github/workflows/docker-build.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
env:
14+
DOCKER_REGISTRY: docker.io
15+
DOCKER_USERNAME: klinux
16+
17+
jobs:
18+
build-backend:
19+
name: Build Backend
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Log in to Docker Hub
33+
if: github.event_name != 'pull_request'
34+
uses: docker/login-action@v3
35+
with:
36+
username: ${{ env.DOCKER_USERNAME }}
37+
password: ${{ secrets.DOCKERHUB_TOKEN }}
38+
39+
- name: Extract metadata
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ env.DOCKER_USERNAME }}/velero-dashboard-backend
44+
tags: |
45+
type=ref,event=branch
46+
type=ref,event=pr
47+
type=semver,pattern={{version}}
48+
type=semver,pattern={{major}}.{{minor}}
49+
type=semver,pattern={{major}}
50+
type=sha,prefix={{branch}}-
51+
type=raw,value=latest,enable={{is_default_branch}}
52+
53+
- name: Build and push
54+
uses: docker/build-push-action@v5
55+
with:
56+
context: ./backend
57+
file: ./backend/Dockerfile
58+
platforms: linux/amd64,linux/arm64
59+
push: ${{ github.event_name != 'pull_request' }}
60+
tags: ${{ steps.meta.outputs.tags }}
61+
labels: ${{ steps.meta.outputs.labels }}
62+
cache-from: type=gha
63+
cache-to: type=gha,mode=max
64+
65+
build-frontend:
66+
name: Build Frontend
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: read
70+
packages: write
71+
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v4
75+
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Log in to Docker Hub
80+
if: github.event_name != 'pull_request'
81+
uses: docker/login-action@v3
82+
with:
83+
username: ${{ env.DOCKER_USERNAME }}
84+
password: ${{ secrets.DOCKERHUB_TOKEN }}
85+
86+
- name: Extract metadata
87+
id: meta
88+
uses: docker/metadata-action@v5
89+
with:
90+
images: ${{ env.DOCKER_USERNAME }}/velero-dashboard-frontend
91+
tags: |
92+
type=ref,event=branch
93+
type=ref,event=pr
94+
type=semver,pattern={{version}}
95+
type=semver,pattern={{major}}.{{minor}}
96+
type=semver,pattern={{major}}
97+
type=sha,prefix={{branch}}-
98+
type=raw,value=latest,enable={{is_default_branch}}
99+
100+
- name: Build and push
101+
uses: docker/build-push-action@v5
102+
with:
103+
context: ./frontend
104+
file: ./frontend/Dockerfile
105+
platforms: linux/amd64,linux/arm64
106+
push: ${{ github.event_name != 'pull_request' }}
107+
tags: ${{ steps.meta.outputs.tags }}
108+
labels: ${{ steps.meta.outputs.labels }}
109+
cache-from: type=gha
110+
cache-to: type=gha,mode=max

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
create-release:
13+
name: Create GitHub Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Generate changelog
23+
id: changelog
24+
run: |
25+
# Get the previous tag
26+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
27+
if [ -z "$PREV_TAG" ]; then
28+
# First release, get all commits
29+
COMMITS=$(git log --pretty=format:"* %s (%h)" --no-merges)
30+
else
31+
# Get commits since previous tag
32+
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"* %s (%h)" --no-merges)
33+
fi
34+
35+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
36+
echo "$COMMITS" >> $GITHUB_OUTPUT
37+
echo "EOF" >> $GITHUB_OUTPUT
38+
39+
- name: Create Release
40+
uses: softprops/action-gh-release@v1
41+
with:
42+
body: |
43+
## Changes
44+
45+
${{ steps.changelog.outputs.CHANGELOG }}
46+
47+
## Docker Images
48+
49+
**Backend:**
50+
```bash
51+
docker pull klinux/velero-dashboard-backend:${{ github.ref_name }}
52+
```
53+
54+
**Frontend:**
55+
```bash
56+
docker pull klinux/velero-dashboard-frontend:${{ github.ref_name }}
57+
```
58+
59+
## Installation
60+
61+
```bash
62+
helm repo add velero-dashboard https://klinux.github.io/velero-dashboard
63+
helm repo update
64+
helm install velero-dashboard velero-dashboard/velero-dashboard --version ${{ github.ref_name }}
65+
```
66+
draft: false
67+
prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test-backend:
11+
name: Test Backend
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
cache: true
23+
cache-dependency-path: backend/go.sum
24+
25+
- name: Run tests
26+
working-directory: ./backend
27+
run: |
28+
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
29+
30+
- name: Upload coverage
31+
uses: codecov/codecov-action@v4
32+
with:
33+
files: ./backend/coverage.txt
34+
flags: backend
35+
token: ${{ secrets.CODECOV_TOKEN }}
36+
37+
test-frontend:
38+
name: Test Frontend
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: '20'
49+
cache: 'npm'
50+
cache-dependency-path: frontend/package-lock.json
51+
52+
- name: Install dependencies
53+
working-directory: ./frontend
54+
run: npm ci
55+
56+
- name: Run tests
57+
working-directory: ./frontend
58+
run: npm run test:run
59+
60+
- name: Run type check
61+
working-directory: ./frontend
62+
run: npx tsc --noEmit
63+
64+
lint-backend:
65+
name: Lint Backend
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
72+
- name: Set up Go
73+
uses: actions/setup-go@v5
74+
with:
75+
go-version: '1.23'
76+
cache: true
77+
cache-dependency-path: backend/go.sum
78+
79+
- name: golangci-lint
80+
uses: golangci/golangci-lint-action@v4
81+
with:
82+
version: latest
83+
working-directory: backend
84+
85+
lint-frontend:
86+
name: Lint Frontend
87+
runs-on: ubuntu-latest
88+
89+
steps:
90+
- name: Checkout code
91+
uses: actions/checkout@v4
92+
93+
- name: Set up Node.js
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version: '20'
97+
cache: 'npm'
98+
cache-dependency-path: frontend/package-lock.json
99+
100+
- name: Install dependencies
101+
working-directory: ./frontend
102+
run: npm ci
103+
104+
- name: Run ESLint
105+
working-directory: ./frontend
106+
run: npm run lint

0 commit comments

Comments
 (0)