mirror of
https://github.com/grassrootseconomics/cic-chain-events.git
synced 2024-11-25 16:46:45 +01:00
ci: enable CGO builds
This commit is contained in:
parent
0ccdaa0345
commit
d9866196f9
@ -1,4 +1,4 @@
|
||||
name: goreleaser
|
||||
name: binary_release
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -8,6 +8,8 @@ on:
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: goreleaser/goreleaser-cross
|
||||
environment: build
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -18,18 +20,12 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.19.3
|
||||
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
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
30
.github/workflows/docker_release.yaml
vendored
Normal file
30
.github/workflows/docker_release.yaml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: docker_release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build-publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: docker/login-action@v1.14.1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: docker compose build push
|
||||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
COMPOSE_DOCKER_CLI_BUILD: 1
|
||||
run: |
|
||||
export TAG=$GITHUB_REF_NAME
|
||||
docker-compose -f docker-compose.build.yaml build --progress plain
|
||||
docker-compose -f docker-compose.build.yaml push
|
||||
export TAG=latest
|
||||
docker-compose -f docker-compose.build.yaml build --progress plain
|
||||
docker-compose -f docker-compose.build.yaml push
|
||||
|
33
.goreleaser
33
.goreleaser
@ -1,33 +0,0 @@
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
main: ./cmd
|
||||
ldflags:
|
||||
- -s -w
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
files:
|
||||
- LICENSE
|
||||
- config.toml
|
||||
- queries.sql
|
||||
- migrations/*
|
||||
|
||||
dockers:
|
||||
- goos: linux
|
||||
goarch: amd64
|
||||
ids:
|
||||
- cic-chain-events
|
||||
image_templates:
|
||||
- "ghcr.io/grassrootseconomics/cic-chain-events/cic-chain-events:latest"
|
||||
- "ghcr.io/grassrootseconomics/cic-chain-events/cic-chain-events:{{ .Tag }}"
|
||||
dockerfile: Dockerfile
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- config.toml
|
||||
- queries.sql
|
||||
- migrations/*
|
21
.goreleaser.yaml
Normal file
21
.goreleaser.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
builds:
|
||||
- id: linux-amd64
|
||||
env:
|
||||
- CGO_ENABLED=1
|
||||
- CC=x86_64-linux-gnu-gcc
|
||||
- CXX=x86_64-linux-gnu-g++
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
main: ./cmd
|
||||
ldflags:
|
||||
- -s -w
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
files:
|
||||
- LICENSE
|
||||
- config.toml
|
||||
- queries.sql
|
||||
- migrations/
|
10
docker-compose.build.yaml
Normal file
10
docker-compose.build.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
version: '3.9'
|
||||
services:
|
||||
cic-chain-events:
|
||||
image: ${IMAGE_BASE_URL:-ghcr.io/grassrootseconomics/cic-chain-events}/cic-chain-events:${TAG:-latest}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
cache_from:
|
||||
- ${IMAGE_BASE_URL:-ghcr.io/grassrootseconomics/cic-chain-events}/cic-chain-events:latest
|
||||
|
Loading…
Reference in New Issue
Block a user