Skip to content

server auth

server auth #21

name: "Build and Release"
on: push
permissions:
contents: write
id-token: write
packages: write
env:
GO_VERSION: 1.22.1
jobs:
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install linux build packages
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update -qq && sudo apt-get install -yq --no-install-recommends \
build-essential \
curl \
autoconf \
automake \
libtool \
pkg-config
- name: Install macos build packages
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install curl autoconf automake libtool pkg-config
- name: Install libpostal
run: |
mkdir /tmp/libpostal_code
mkdir /tmp/libpostal_datadir
- name: Install libpostal
run: git clone https://github.com/openvenues/libpostal
working-directory: /tmp/libpostal_code
- name: Install libpostal
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
./bootstrap.sh
./configure --datadir=/tmp/libpostal_datadir
make -j4
sudo make install
sudo ldconfig /usr/local/lib
working-directory: /tmp/libpostal_code/libpostal
- name: Install libpostal
if: ${{ matrix.os == 'macos-latest' }}
run: |
./bootstrap.sh
./configure --datadir=/tmp/libpostal_datadir --disable-sse2
make -j4
sudo make install
working-directory: /tmp/libpostal_code/libpostal
- name: CLI tests
run: |
go mod tidy
go test -v ./...
- name: Setup Syft for SBOM
uses: anchore/sbom-action/download-syft@v0
if: success() && startsWith(github.ref, 'refs/tags/')
# - name: Import GPG key
# id: import_gpg
# uses: crazy-max/ghaction-import-gpg@v6
# if: success() && startsWith(github.ref, 'refs/tags/')
# with:
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
if: ${{ matrix.os == 'ubuntu-latest' }}
# if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean --skip=publish --snapshot -f .goreleaser.linux.yml
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# - name: Run GoReleaser
# uses: goreleaser/goreleaser-action@v5
# if: ${{ matrix.os == 'macos-latest' }}
# # if: success() && startsWith(github.ref, 'refs/tags/')
# with:
# version: latest
# args: release --clean --skip=publish --snapshot -f .goreleaser.macos.yml
# # env:
# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
# # GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}