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