Skip to content

Commit

Permalink
local build
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Jul 6, 2024
1 parent fab99ce commit 604a83a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ jobs:
with:
context: .
push: true
platforms: ${{ matrix.os == 'ubuntu-latest' && 'linux/amd64,linux/arm64' || 'darwin' }}
platforms: ${{ matrix.os == 'ubuntu-latest' && 'linux/amd64,linux/arm64' || 'darwin/amd64' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
${{ matrix.os == 'macos-latest' && 'LIBPOSTAL_CONFIGURE_FLAGS=--disable-sse2' }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
FROM golang:1.22

# args
ARG BUILDARCH
ARG GIN_MODE=release
ARG LIBPOSTAL_CONFIGURE_FLAGS=

# Set up environment variables
ENV GIN_MODE=${GIN_MODE} \
LIBPOSTAL_CONFIGURE_FLAGS=${LIBPOSTAL_CONFIGURE_FLAGS}
ENV GIN_MODE=${GIN_MODE}

# Install packages needed to build gems
RUN apt-get update -qq && apt-get install -yq --no-install-recommends \
Expand All @@ -23,10 +22,11 @@ RUN apt-get update -qq && apt-get install -yq --no-install-recommends \

# install libpostal

RUN echo $BUILDARCH
RUN git clone https://github.com/openvenues/libpostal /code/libpostal
WORKDIR /code/libpostal
RUN ./bootstrap.sh && \
./configure --datadir=/usr/share/libpostal ${LIBPOSTAL_CONFIGURE_FLAGS} && \
./configure --datadir=/usr/share/libpostal $([ "$BUILDARCH" = "arm64" ] && echo "--disable-sse2" || echo "") && \
make -j4 && make check && make install && \
ldconfig

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,5 @@ POSTAL_SERVER_BEARER_AUTH_TOKEN - bearer auth token
Local build:

```bash
# x86 linux or mac os
docker build -t postal-server .
# mac os with apple silicon
docker build -t postal-server --build-arg LIBPOSTAL_CONFIGURE_FLAGS=--disable-sse2 .
```

0 comments on commit 604a83a

Please sign in to comment.