-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add github action to release binaries on tags
Signed-off-by: Praveen Yadav <pyadav9678@gmail.com>
- Loading branch information
Showing
7 changed files
with
194 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
dev: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.0" | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Publish dev image | ||
id: docker_dev_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
file: "./docker/Dockerfile.gateway.dev" | ||
tags: missingstudio/gateway:dev | ||
releaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.0" | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ Chart.lock | |
**/*.tgz | ||
|
||
go.work.sum | ||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
project_name: gateway | ||
|
||
before: | ||
hooks: | ||
- make test | ||
|
||
release: | ||
prerelease: auto | ||
|
||
builds: | ||
- id: gateway | ||
goos: [linux, darwin, windows] | ||
goarch: [amd64, arm64] | ||
binary: gateway | ||
dir: ./gateway | ||
main: ./ | ||
ldflags: | ||
- -s -w -X github.com/missinstudio/ai/gateway/config.Version={{.Tag}} | ||
- -X github.com/missinstudio/ai/gateway/config.BuildCommit={{.FullCommit}} | ||
- -X github.com/missinstudio/ai/gateway/config.BuildDate={{.Date}} | ||
env: | ||
- CGO_ENABLED=0 | ||
|
||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of `uname`. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
# use zip for windows archives | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
|
||
checksum: | ||
name_template: "{{ .ProjectName }}_v{{ .Version }}_checksums.txt" | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
|
||
|
||
dockers: | ||
- goos: linux | ||
goarch: amd64 | ||
ids: | ||
- gateway | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- "docker.io/missingstudio/{{.ProjectName}}:latest" | ||
- "docker.io/missingstudio/{{.ProjectName}}:{{ .Tag }}" | ||
- "docker.io/missingstudio/{{.ProjectName}}:{{ .Tag }}-amd64" | ||
- goos: linux | ||
goarch: arm64 | ||
ids: | ||
- gateway | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- "docker.io/missingstudio/{{.ProjectName}}:{{ .Tag }}-arm64" | ||
|
||
|
||
nfpms: | ||
- maintainer: Missing studio | ||
description: A robust cloud-native AI Gateway | ||
homepage: https://github.com/missingstudio/gateway | ||
license: Apache 2.0 | ||
formats: | ||
- deb | ||
- rpm | ||
|
||
scoops: | ||
- homepage: https://github.com/missingstudio/gateway | ||
description: A robust cloud-native AI Gateway | ||
license: Apache 2.0 | ||
repository: | ||
owner: raystack | ||
name: scoop-bucket | ||
|
||
brews: | ||
- name: gateway | ||
homepage: https://github.com/missingstudio/gateway | ||
description: A robust cloud-native AI Gateway | ||
repository: | ||
owner: missingstudio | ||
name: homebrew-tap | ||
license: Apache 2.0 | ||
folder: Formula | ||
dependencies: | ||
- name: git | ||
install: |- | ||
bin.install "gateway" | ||
commit_author: | ||
name: Missing studio | ||
email: support@missing.studio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM golang:1.22-alpine3.18 as builder | ||
|
||
RUN apk add make | ||
|
||
WORKDIR /go/src/app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN make build | ||
|
||
FROM alpine:3.18 | ||
COPY --from=builder /go/src/app/frontier /usr/bin/ | ||
RUN apk update | ||
RUN apk add ca-certificates | ||
|
||
# glibc compatibility library, since go binaries | ||
# don't work well with musl libc that alpine uses | ||
RUN apk add libc6-compat | ||
|
||
ENTRYPOINT ["frontier", "server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters