Skip to content

Commit

Permalink
Merge pull request #47 from averak/release/v0.2.0
Browse files Browse the repository at this point in the history
Release/v0.2.0
  • Loading branch information
averak authored Aug 2, 2024
2 parents 992481c + e91324d commit f9c8903
Show file tree
Hide file tree
Showing 140 changed files with 15,234 additions and 668 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Build Docker Image

on:
release:
types: [ published ]
push:
branches:
- develop

jobs:
api-server:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: get version
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV

- uses: docker/build-push-action@v5
with:
file: ./docker/api-server/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
async-worker:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: get version
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV

- uses: docker/build-push-action@v5
with:
file: ./docker/async-worker/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
batch-job:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: get version
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV

- uses: docker/build-push-action@v5
with:
file: ./docker/batch-job/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
db-migrate:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: get version
run: echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV

- uses: docker/build-push-action@v5
with:
file: ./docker/db-migrate/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: setup database
run: |
docker compose up -d
make db-migrate
- name: test
run: |
Expand Down Expand Up @@ -56,7 +55,6 @@ jobs:
- name: setup database
run: |
docker compose up -d
make db-migrate
- name: dependencies
if: steps.cache-makefile.outputs.cache-hit != 'true'
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ GO_LDFLAGS := -s -w -X github.com/averak/hbaas/app/core/build_info.serverVersion

.PHONY: install-tools
install-tools:
go install ./cmd/protoc-gen-hbaas-server
go install github.com/bufbuild/buf/cmd/buf@${BUF_VERSION}
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/fdaines/arch-go@latest
Expand All @@ -29,7 +30,7 @@ lint:
codegen:
find . -type f \( -name 'wire_gen.go' \) -delete
wire ./...
find . -type f \( -name '*.connect.go' -or -name '*.pb.go' \) -delete
find . -type f \( -name '*.connect.go' -or -name '*.pb.go' -or -name '*.hbaas.go' \) -delete
buf generate
sqlboiler psql --wipe --templates=templates/sqlboiler,$(shell go env GOPATH)/pkg/mod/github.com/volatiletech/sqlboiler/v4@${SQL_BOILER_VERSION}/templates/main

Expand All @@ -49,12 +50,20 @@ db-clean:
docker-compose up -d postgres

.PHONY: build
build: build-api-server
build: build-api-server build-async-worker build-batch-job

.PHONE: build-api-server
build-api-server:
CGO_ENABLED=0 go build -ldflags="$(GO_LDFLAGS)" -o tmp/build/api_server ./entrypoint/api_server

.PHONY: build-async-worker
build-async-worker:
CGO_ENABLED=0 go build -ldflags="$(GO_LDFLAGS)" -o tmp/build/async_worker ./entrypoint/async_worker

.PHONY: build-batch-job
build-batch-job:
CGO_ENABLED=0 go build -ldflags="$(GO_LDFLAGS)" -o tmp/build/batch_job ./entrypoint/batch_job

.PHONY: run-api-server
run-api-server:
go run -ldflags="$(GO_LDFLAGS)" ./entrypoint/api_server
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ We provide SDKs for various platforms such as Web, iOS, and Android.
## Features

- User Authentication
- Leader Board
- Realtime Messaging
- Key-Value Store
- File Storage
Expand Down
8 changes: 8 additions & 0 deletions app/adapter/dao/boil_table_names.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f9c8903

Please sign in to comment.