Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0acef09910 | ||
|
|
24fb916074 | ||
|
|
5aaadf4fe6 | ||
|
|
30a5e8340e | ||
|
|
42ea0f58fd | ||
|
|
1fc4977d96 |
@@ -16,6 +16,7 @@ on:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
if: 0
|
||||
name: Run golangci-lint
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
@@ -43,6 +44,7 @@ jobs:
|
||||
golangci-lint run -c ./.golangci-lint.yaml --fix=false --color=always
|
||||
|
||||
build:
|
||||
if: 0
|
||||
name: Build golang services
|
||||
runs-on: ubuntu-22.04
|
||||
needs: lint
|
||||
@@ -67,10 +69,11 @@ jobs:
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o main cmd/main.go
|
||||
|
||||
push:
|
||||
if: 0
|
||||
name: Push Docker Images
|
||||
runs-on: ubuntu-22.04
|
||||
needs: lint
|
||||
if: ${{ gitea.ref == 'refs/heads/master' || gitea.ref == 'refs/heads/release' }}
|
||||
# if: ${{ gitea.ref == 'refs/heads/master' || gitea.ref == 'refs/heads/release' }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -140,6 +143,10 @@ jobs:
|
||||
tag:
|
||||
name: Tag Commit
|
||||
runs-on: ubuntu-22.04
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- when: always
|
||||
# needs: lint
|
||||
|
||||
steps:
|
||||
@@ -153,6 +160,7 @@ jobs:
|
||||
run: |
|
||||
git fetch --tags
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo 'v0.0.0')
|
||||
echo $LATEST_TAG
|
||||
|
||||
if [[ $LATEST_TAG =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
|
||||
MAJOR=${BASH_REMATCH[1]}
|
||||
@@ -164,6 +172,8 @@ jobs:
|
||||
PATCH=0
|
||||
fi
|
||||
|
||||
echo $MAJOR.$MINOR.$PATCH
|
||||
|
||||
NEW_PATCH=$((PATCH + 1))
|
||||
NEW_TAG="v${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user