From cc228a7e9fe54e215dbac069f79c51375d780ee3 Mon Sep 17 00:00:00 2001 From: Tosone Date: Fri, 29 Dec 2023 11:42:13 +0800 Subject: [PATCH] :green_heart: Update tag release config (#265) --- .github/workflows/image-build.yml | 18 ++++++++++++------ CHANGELOG.md | 2 +- Makefile | 12 ++++++------ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index 10806bc7..9843c256 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -49,6 +49,9 @@ jobs: with: images: | ghcr.io/${{ github.repository }} + flavor: | + latest=auto + suffix=-debian,onlatest=true tags: | type=ref,event=pr type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }} @@ -61,8 +64,8 @@ jobs: with: context: . file: build/Dockerfile - platforms: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} - push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }} + platforms: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && 'linux/amd64,linux/arm64' || 'linux/amd64' }} + push: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} provenance: false @@ -101,6 +104,9 @@ jobs: with: images: | ghcr.io/${{ github.repository }} + flavor: | + latest=auto + suffix=-debian,onlatest=true tags: | type=ref,event=pr type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }} @@ -113,8 +119,8 @@ jobs: with: context: . file: build/Dockerfile.debian - platforms: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} - push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }} + platforms: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && 'linux/amd64,linux/arm64' || 'linux/amd64' }} + push: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} provenance: false @@ -165,8 +171,8 @@ jobs: with: context: . file: build/Dockerfile.builder - platforms: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} - push: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }} + platforms: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && 'linux/amd64,linux/arm64' || 'linux/amd64' }} + push: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} provenance: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b1541dd..45ed64f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features -* Add changlog config +* Add changlog config ([#263](https://github.com/go-sigma/sigma/issues/263)) * Add introduction for sigma ([#260](https://github.com/go-sigma/sigma/issues/260)) * Show elapsed on builder page ([#257](https://github.com/go-sigma/sigma/issues/257)) * Change cache api ([#256](https://github.com/go-sigma/sigma/issues/256)) diff --git a/Makefile b/Makefile index 3eca4192..cab4048a 100644 --- a/Makefile +++ b/Makefile @@ -98,16 +98,16 @@ docker-build: ## Use the dockerfile to build the sigma image docker-build-builder: ## Use the dockerfile to build the sigma-builder image docker buildx build -f build/Dockerfile.builder --platform $(DOCKER_PLATFORMS) --progress plain --output type=docker,name=$(DOCKER_REGISTRY)/$(BINARY_NAME)-builder:latest,push=false,oci-mediatypes=true . -## Format: -format: sql-format - -sql-format: ## format all sql files - @find ${PWD}/pkg/dal/migrations -type f -iname "*.sql" -print | xargs pg_format -s 2 --inplace - ## Misc: migration-create: ## Create a new migration file @migrate create -dir ./migrations -seq -digits 4 -ext sql $(MIGRATION_NAME) +sql-format: ## Format all sql files + @find ${PWD}/pkg/dal/migrations -type f -iname "*.sql" -print | xargs pg_format -s 2 --inplace + +changelog: ## Generate changelog + @docker run -v "${PWD}":/workdir quay.io/git-chglog/git-chglog:latest -o CHANGELOG.md + gormgen: ## Generate gorm model from database @$(GOCMD) run ./pkg/dal/cmd/gen.go