From 178fd7e154407e9b9c30893f7c7537f009463013 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Sun, 23 Oct 2022 12:16:10 +0000 Subject: [PATCH] ci: add release, package checks, deepsource --- .deepsource.toml | 9 +++++++++ .github/dependabot.yaml | 6 ++++++ .github/workflows/release.yaml | 35 ++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 29 ++++++++++++++++++++++++++++ Dockerfile | 13 +++++++++++++ Makefile | 0 6 files changed, 92 insertions(+) create mode 100644 .deepsource.toml create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yaml create mode 100644 Dockerfile delete mode 100644 Makefile diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..57ec587 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,9 @@ +version = 1 + +[[analyzers]] +name = "go" +enabled = true + + [analyzers.meta] + import_root = "github.com/grassrootseconomics/cic-custodial" + \ No newline at end of file diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..f1b219b --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ec406e9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,35 @@ +name: goreleaser + +on: + push: + tags: + - "v*" + +jobs: + goreleaser: + runs-on: ubuntu-latest + environment: build + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.19 + + - name: Login to Docker Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: --parallelism 1 --rm-dist --skip-validate + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..05489ac --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,29 @@ +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + main: ./cmd/service + ldflags: + - -s -w + +archives: + - format: tar.gz + files: + - LICENSE + - config.toml + +dockers: + - goos: linux + goarch: amd64 + ids: + - cic-dw + image_templates: + - "ghcr.io/grassrootseconomics/cic-custodial/cic-custodial:latest" + - "ghcr.io/grassrootseconomics/cic-custodial/cic-custodial:{{ .Tag }}" + dockerfile: Dockerfile + extra_files: + - config.toml + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a142949 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM debian:11-slim + +RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /cic-custodial + +COPY cic-custodial . +COPY config.toml . + +EXPOSE 5000 +CMD ["./cic-dw"] diff --git a/Makefile b/Makefile deleted file mode 100644 index e69de29..0000000