Skip to content

Commit

Permalink
Merge pull request #63 from webhookdb/new-owner
Browse files Browse the repository at this point in the history
Updates for open-source webhookdb
  • Loading branch information
rgalanakis authored Jan 9, 2024
2 parents 99f555b + df5ae08 commit 22613d8
Show file tree
Hide file tree
Showing 49 changed files with 283 additions and 260 deletions.
28 changes: 28 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

webhookdb-cli
webhookdb
webhookdb.wasm

dist/
.env
temp/

.idea/
*.yaml
.gitignore
.github
38 changes: 38 additions & 0 deletions .github/workflows/deploy-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
release:
types: [ published ]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: webhookdb/webhookdb-cli

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GIT_REF=${{ github.ref }}
GIT_SHA=${{ github.sha }}
RELEASED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ"
7 changes: 5 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: PR Checks
on: pull_request
name: Tests
on:
pull_request:
push:
branches: [ main ]
jobs:
run-tests:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: goreleaser
name: Release

on:
push:
Expand Down
8 changes: 4 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project_name: webhookdb
builds:
- id: distrib
ldflags:
- -s -w -X github.com/lithictech/webhookdb-cli/config.Version={{.Version}} -X github.com/lithictech/webhookdb-cli/config.BuildSha={{.Commit}} -X github.com/lithictech/webhookdb-cli/config.BuildTime={{.Date}}
- -s -w -X github.com/webhookdb/webhookdb-cli/config.Version={{.Version}} -X github.com/webhookdb/webhookdb-cli/config.BuildSha={{.Commit}} -X github.com/webhookdb/webhookdb-cli/config.BuildTime={{.Date}}
binary: webhookdb
goos:
- linux
Expand All @@ -16,7 +16,7 @@ builds:
goarch: arm64
- id: wasm
ldflags:
- -s -w -X github.com/lithictech/webhookdb-cli/config.Version={{.Version}} -X github.com/lithictech/webhookdb-cli/config.BuildSha={{.Commit}} -X github.com/lithictech/webhookdb-cli/config.BuildTime={{.Date}}
- -s -w -X github.com/webhookdb/webhookdb-cli/config.Version={{.Version}} -X github.com/webhookdb/webhookdb-cli/config.BuildSha={{.Commit}} -X github.com/webhookdb/webhookdb-cli/config.BuildTime={{.Date}}
binary: webhookdb
targets:
- js_wasm
Expand Down Expand Up @@ -67,15 +67,15 @@ blobs:
folder: "webhookdb-cli/{{.Version}}"
brews:
- repository:
owner: lithictech
owner: webhookdb
name: homebrew-webhookdb
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
branch: next
ids:
- distrib
commit_author:
name: webhookdbreleaser
email: [email protected]
email: [email protected]
description: "Query and store any API in real-time with SQL. More at https://webhookdb.com"
homepage: "https://webhookdb.com"
caveats: "❤ Thanks for installing the WebhookDB CLI! Run `webhookdb auth login` to get register or sign in."
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.17

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . ./

ARG RELEASED_AT="-"
ARG GIT_SHA="-"
ARG GIT_REF="-"

RUN go build -ldflags "-X github.com/webhookdb/webhookdb-cli/config.BuildTime=${RELEASED_AT} -X github.com/webhookdb/webhookdb-cli/config.BuildSha=${GIT_SHA} -X github.com/webhookdb/webhookdb-cli/config.Version=${GIT_REF}" -o webhookdb

ENTRYPOINT ["./webhookdb"]
Loading

0 comments on commit 22613d8

Please sign in to comment.