Skip to content

Commit

Permalink
ci: docker (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
caarlos0 authored Aug 5, 2024
1 parent 009148c commit 635d2f2
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: release

on:
workflow_dispatch:
push:
tags:
- "*"

permissions:
contents: write
id-token: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: stable
- uses: docker/setup-qemu-action@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> 2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.pem

dist/
91 changes: 91 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

project_name: akash-rpc-proxy

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

archives:
- format: tar.gz
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 }}
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

nfpms:
- vendor: "Akash Network"
homepage: "https://akash.network"
maintainer: "Akash Network <[email protected]>"
license: Apache 2.0
formats:
- apk
- deb
- rpm

dockers:
- dockerfile: Dockerfile
use: buildx
goarch: amd64
goos: linux
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url={{.GitURL}}
- --label=org.opencontainers.image.source={{.GitURL}}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
image_templates:
- "ghcr.io/akash-network/rpc-proxy:{{ .Version }}-amd64"
- dockerfile: Dockerfile
use: buildx
goarch: arm64
goos: linux
build_flag_templates:
- --platform=linux/arm64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url={{.GitURL}}
- --label=org.opencontainers.image.source={{.GitURL}}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
image_templates:
- "ghcr.io/akash-network/rpc-proxy:{{ .Version }}-arm64"

docker_manifests:
- name_template: "ghcr.io/akash-network/rpc-proxy:{{ .Version }}"
image_templates:
- "ghcr.io/akash-network/rpc-proxy:{{ .Version }}-amd64"
- "ghcr.io/akash-network/rpc-proxy:{{ .Version }}-arm64"
- name_template: "{{ .Env.DOCKER_IMAGE }}:latest"
image_templates:
- "ghcr.io/akash-network/rpc-proxy:{{ .Version }}-amd64"
- "ghcr.io/akash-network/rpc-proxy:{{ .Version }}-arm64"
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine
EXPOSE 443
ENTRYPOINT ["/usr/bin/akash-rpc-proxy"]
COPY *.apk /tmp/
RUN apk add --allow-untrusted /tmp/*.apk

0 comments on commit 635d2f2

Please sign in to comment.