From 3cc59d7ddf3b650eb9f03eda8776309e97e1bbfb Mon Sep 17 00:00:00 2001 From: timofey-kurakin-m10 <124785785+timofey-kurakin-m10@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:46:48 +0400 Subject: [PATCH] deploy --- .github/workflows/release.yml | 24 ++++++------- .goreleaser.yml | 66 +++++++++++++++++------------------ Makefile | 13 +++---- 3 files changed, 51 insertions(+), 52 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02e921a81..57b149737 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,11 @@ name: Release on: - push: - branches-ignore: - - '**' - tags: - - 'v*.*.*' - # to be used by fork patch-releases ^^ - - 'v*.*.*-*' + workflow_dispatch: + inputs: + TAG: + description: TAG (e.g., 1.0.0) + required: true jobs: goreleaser: @@ -20,9 +18,10 @@ jobs: - name: Prepare id: prepare + env: + TAG: latest run: | - TAG=${GITHUB_REF#refs/tags/} - echo ::set-output name=tag_name::${TAG} + echo ::set-output name=tag_name::latest - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -31,7 +30,6 @@ jobs: run: | make release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ steps.prepare.outputs.tag_name }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN_WRITE_PACKAGES }} + VERSION: latest + TAG: latest diff --git a/.goreleaser.yml b/.goreleaser.yml index 56f7d86db..571d6e090 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,14 +11,14 @@ builds: env: - CGO_ENABLED=0 goos: - - freebsd - - windows + #- freebsd + #- windows - darwin - linux goarch: - amd64 - - arm64 - - arm + #- arm64 + #- arm goarm: - '7' ldflags: @@ -124,7 +124,7 @@ snapshot: dockers: - image_templates: - - dkron/{{ .ProjectName }}:{{ .Version }}-amd64 + - ghcr.io/m10-payments/{{ .ProjectName }}:{{ .Version }}-amd64 dockerfile: Dockerfile.release use: buildx goos: linux @@ -145,39 +145,39 @@ dockers: build_flag_templates: - --platform=linux/amd64 - - image_templates: - - dkron/{{ .ProjectName }}:{{ .Version }}-arm64 - dockerfile: Dockerfile.release - use: buildx - goos: linux - goarch: arm64 - ids: *docker-ids - build_flag_templates: - - --platform=linux/arm64/v8 - - - image_templates: - - dkron/{{ .ProjectName }}:{{ .Version }}-armv7 - dockerfile: Dockerfile.release - use: buildx - goos: linux - goarch: arm - goarm: '7' - ids: *docker-ids - build_flag_templates: - - --platform=linux/arm/v7 + #- image_templates: + # - ghcr.io/m10-payments/{{ .ProjectName }}:{{ .Version }}-arm64 + # dockerfile: Dockerfile.release + # use: buildx + # goos: linux + # goarch: arm64 + # ids: *docker-ids + # build_flag_templates: + # - --platform=linux/arm64/v8 + + #- image_templates: + # - ghcr.io/m10-payments/{{ .ProjectName }}:{{ .Version }}-armv7 + # dockerfile: Dockerfile.release + # use: buildx + # goos: linux + # goarch: arm + # goarm: '7' + # ids: *docker-ids + # build_flag_templates: + # - --platform=linux/arm/v7 docker_manifests: - - name_template: dkron/{{ .ProjectName }}:{{ .Version }} + - name_template: ghcr.io/m10-payments/{{ .ProjectName }}:{{ .Version }} image_templates: - - dkron/{{ .ProjectName }}:{{ .Version }}-amd64 - - dkron/{{ .ProjectName }}:{{ .Version }}-arm64 - - dkron/{{ .ProjectName }}:{{ .Version }}-armv7 + - ghcr.io/m10-payments/{{ .ProjectName }}:{{ .Version }}-amd64 + #- dkron/{{ .ProjectName }}:{{ .Version }}-arm64 + #- dkron/{{ .ProjectName }}:{{ .Version }}-armv7 - - name_template: dkron/{{ .ProjectName }}:latest + - name_template: ghcr.io/m10-payments/{{ .ProjectName }}:latest image_templates: - - dkron/{{ .ProjectName }}:{{ .Version }}-amd64 - - dkron/{{ .ProjectName }}:{{ .Version }}-arm64 - - dkron/{{ .ProjectName }}:{{ .Version }}-armv7 + - ghcr.io/m10-payments/{{ .ProjectName }}:{{ .Version }}-amd64 + #- dkron/{{ .ProjectName }}:{{ .Version }}-arm64 + #- dkron/{{ .ProjectName }}:{{ .Version }}-armv7 changelog: sort: asc diff --git a/Makefile b/Makefile index 9acaf5318..98dc3cfdc 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ fury: $(LINUX_PKGS) $(LINUX_PKGS): fury push --as distribworks $@ -PACKAGE_NAME := github.com/distribworks/dkron -GOLANG_CROSS_VERSION ?= v1.18.1 +PACKAGE_NAME := ghcr.io/m10-payments/dkron +GOLANG_CROSS_VERSION ?= v1.21.5 .PHONY: release-dry-run release-dry-run: @@ -15,6 +15,7 @@ release-dry-run: -v ${PWD}:/dkron \ -w /dkron \ -e GITHUB_TOKEN \ + -e VERSION=${VERSION} \ -e DOCKER_USERNAME \ -e DOCKER_PASSWORD \ -e DOCKER_REGISTRY \ @@ -22,7 +23,7 @@ release-dry-run: -v `pwd`:/go/src/$(PACKAGE_NAME) \ -w /go/src/$(PACKAGE_NAME) \ goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ - --rm-dist --skip-validate --skip-publish --timeout=1h + --rm-dist --skip-validate --skip-publish --timeout=1h --parallelism=1 .PHONY: release release: @@ -32,14 +33,14 @@ release: -v ${PWD}:/dkron \ -w /dkron \ -e GITHUB_TOKEN \ + -e VERSION=${VERSION} \ -e DOCKER_USERNAME \ -e DOCKER_PASSWORD \ -e DOCKER_REGISTRY \ + -e GORELEASER_CURRENT_TAG=v3.2.7-M1 \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v `pwd`:/go/src/$(PACKAGE_NAME) \ - -w /go/src/$(PACKAGE_NAME) \ goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ - --rm-dist --skip-validate --timeout=1h + release --rm-dist --skip-validate --timeout=1h .PHONY: clean clean: