From a844ccfc8817b2812ebc93c38fb7a2aa58831f37 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Thu, 12 Feb 2026 18:04:36 +0300 Subject: [PATCH] add release configs --- .gitea/workflows/release.yml | 58 ++++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 37 +++++++++++++++++++++++ Dockerfile | 21 +++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .gitea/workflows/release.yml create mode 100644 .goreleaser.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..3870ccf --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,58 @@ +name: release + +on: + push: + tags: + - 'v*' + +jobs: + + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version-file: 'go.mod' + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: 'v2.13.2' + distribution: goreleaser + args: release --clean + env: + GITEA_TOKEN: '${{ secrets.RELEASE_TOKEN }}' + + docker-image: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Yandex Cloud Container Registry + uses: docker/login-action@v3 + with: + registry: cr.yandex + username: oauth + password: ${{ secrets.YANDEX_CLOUD_OAUTH_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + file: ./Dockerfile + context: . + push: true + tags: | + cr.yandex/${{ secrets.YANDEX_CLOUD_REGISTRY_ID }}/remembos:${{ github.ref_name }} + cr.yandex/${{ secrets.YANDEX_CLOUD_REGISTRY_ID }}/remembos:latest + platforms: linux/amd64 \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..4efbaf2 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,37 @@ +version: 2 + +project_name: remembos + +builds: + - id: remembos + main: ./cmd/remembos + binary: remembos + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + +archives: + - id: remembos + formats: + - tar.gz + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - README.md + - config.dist.toml + +checksum: + name_template: checksums.txt + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +gitea_urls: + api: https://git.vakhrushev.me/api/v1 + download: https://git.vakhrushev.me diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bada236 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM golang:1.26.0-alpine AS build + +WORKDIR /src + +COPY go.mod . +COPY go.sum . + +RUN go mod download + +COPY . . + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/remembos ./cmd/remembos + + +FROM gcr.io/distroless/static:nonroot + +COPY --from=build /out/remembos /remembos + +USER nonroot:nonroot + +ENTRYPOINT ["/remembos"]