2019-09-30 12:42:49 +03:00
|
|
|
name: CI
|
2019-09-29 21:47:24 +03:00
|
|
|
|
2020-05-05 14:13:48 +03:00
|
|
|
on:
|
|
|
|
push:
|
2023-07-04 00:29:44 +03:00
|
|
|
branches: [ main ]
|
2020-05-05 14:13:48 +03:00
|
|
|
pull_request:
|
2023-07-04 00:29:44 +03:00
|
|
|
branches: [ main ]
|
2023-05-30 04:00:44 +03:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- 'demo/**'
|
|
|
|
- 'docs/**'
|
2022-10-07 23:32:40 +03:00
|
|
|
release:
|
2023-07-04 00:29:44 +03:00
|
|
|
types: [ published ]
|
2022-10-31 23:28:21 +03:00
|
|
|
workflow_dispatch:
|
2019-09-29 21:47:24 +03:00
|
|
|
|
2023-09-26 03:27:55 +03:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2019-09-29 21:47:24 +03:00
|
|
|
jobs:
|
2023-10-01 05:49:56 +03:00
|
|
|
lint-debug-test:
|
|
|
|
name: Lint and Unit test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
PGDATABASE: test
|
|
|
|
PGHOST: localhost
|
|
|
|
PGUSER: postgres
|
|
|
|
PGPASSWORD: postgres
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgis/postgis:16-3.4
|
|
|
|
ports:
|
|
|
|
# will assign a random free host port
|
|
|
|
- 5432/tcp
|
|
|
|
# Sadly there is currently no way to pass arguments to the service image other than this hack
|
|
|
|
# See also https://stackoverflow.com/a/62720566/177275
|
|
|
|
options: >-
|
|
|
|
-e POSTGRES_DB=test
|
|
|
|
-e POSTGRES_USER=postgres
|
|
|
|
-e POSTGRES_PASSWORD=postgres
|
|
|
|
-e PGDATABASE=test
|
|
|
|
-e PGUSER=postgres
|
|
|
|
-e PGPASSWORD=postgres
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
--entrypoint sh
|
|
|
|
postgis/postgis:16-3.4
|
|
|
|
-c "exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"
|
|
|
|
steps:
|
2023-12-25 07:43:58 +03:00
|
|
|
- uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: just
|
2023-10-12 07:37:03 +03:00
|
|
|
- name: Checkout sources
|
2023-10-01 05:49:56 +03:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
|
2023-12-25 07:43:58 +03:00
|
|
|
- run: just env-info
|
|
|
|
- run: just fmt
|
|
|
|
- run: just clippy
|
|
|
|
- run: just check
|
|
|
|
- run: just check-doc
|
2023-10-01 05:49:56 +03:00
|
|
|
- name: Init database
|
|
|
|
run: tests/fixtures/initdb.sh
|
|
|
|
env:
|
|
|
|
PGPORT: ${{ job.services.postgres.ports[5432] }}
|
|
|
|
- name: Run cargo test
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
cargo test --package martin-tile-utils
|
2023-10-28 11:50:49 +03:00
|
|
|
cargo test --package mbtiles --no-default-features
|
|
|
|
cargo test --package mbtiles
|
2023-10-01 05:49:56 +03:00
|
|
|
cargo test --package martin
|
|
|
|
cargo test --doc
|
|
|
|
env:
|
|
|
|
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=require
|
|
|
|
|
|
|
|
docker-build-test:
|
2023-09-30 07:45:15 +03:00
|
|
|
name: Build and test docker images
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
# PG_* variables are used by psql
|
|
|
|
PGDATABASE: test
|
|
|
|
PGHOST: localhost
|
|
|
|
PGUSER: postgres
|
|
|
|
PGPASSWORD: postgres
|
|
|
|
# TODO: aarch64-unknown-linux-gnu
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgis/postgis:15-3.3
|
|
|
|
ports:
|
|
|
|
- 5432/tcp
|
|
|
|
options: >-
|
|
|
|
-e POSTGRES_DB=test
|
|
|
|
-e POSTGRES_USER=postgres
|
|
|
|
-e POSTGRES_PASSWORD=postgres
|
|
|
|
-e PGDATABASE=test
|
|
|
|
-e PGUSER=postgres
|
|
|
|
-e PGPASSWORD=postgres
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
--entrypoint sh
|
|
|
|
postgis/postgis:15-3.3
|
|
|
|
-c "exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-09-30 07:45:15 +03:00
|
|
|
steps:
|
2023-12-19 08:17:11 +03:00
|
|
|
- uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: cross
|
2023-09-30 07:45:15 +03:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v4
|
2023-12-22 09:01:50 +03:00
|
|
|
with:
|
|
|
|
set-safe-directory: false
|
2023-09-30 07:45:15 +03:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2023-09-30 07:52:08 +03:00
|
|
|
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
|
2023-10-01 05:49:56 +03:00
|
|
|
- name: Init database
|
2023-09-30 07:45:15 +03:00
|
|
|
run: tests/fixtures/initdb.sh
|
|
|
|
env:
|
|
|
|
PGPORT: ${{ job.services.postgres.ports[5432] }}
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
# https://github.com/docker/setup-qemu-action
|
|
|
|
with:
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
# https://github.com/docker/setup-buildx-action
|
|
|
|
with:
|
|
|
|
install: true
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
|
|
|
- name: Build targets
|
|
|
|
run: |
|
2023-12-16 22:59:52 +03:00
|
|
|
for target in "aarch64-unknown-linux-musl" "x86_64-unknown-linux-musl"; do
|
2023-09-30 07:45:15 +03:00
|
|
|
echo -e "\n----------------------------------------------"
|
|
|
|
echo "Building $target"
|
|
|
|
|
|
|
|
export "CARGO_TARGET_$(echo $target | tr 'a-z-' 'A-Z_')_RUSTFLAGS"='-C strip=debuginfo'
|
2023-10-28 11:50:49 +03:00
|
|
|
cross build --release --target $target --package mbtiles
|
2023-09-30 12:58:49 +03:00
|
|
|
cross build --release --target $target --package martin
|
2023-09-30 07:45:15 +03:00
|
|
|
|
|
|
|
mkdir -p target_releases/$target
|
|
|
|
mv target/$target/release/martin target_releases/$target
|
2023-11-20 09:27:51 +03:00
|
|
|
mv target/$target/release/martin-cp target_releases/$target
|
|
|
|
mv target/$target/release/mbtiles target_releases/$target
|
2023-09-30 07:45:15 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
- name: Save build artifacts to build-${{ matrix.target }}
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-09-30 07:45:15 +03:00
|
|
|
with:
|
|
|
|
name: cross-build
|
|
|
|
path: target_releases/*
|
|
|
|
- name: Reorganize artifacts for docker build
|
|
|
|
run: |
|
|
|
|
mkdir -p target_releases/linux/arm64
|
|
|
|
mv target_releases/aarch64-unknown-linux-musl/* target_releases/linux/arm64/
|
|
|
|
mkdir -p target_releases/linux/amd64
|
|
|
|
mv target_releases/x86_64-unknown-linux-musl/* target_releases/linux/amd64/
|
|
|
|
|
2023-12-22 09:01:50 +03:00
|
|
|
- name: Start HTTP Server
|
|
|
|
run: |
|
|
|
|
docker run --rm -d \
|
|
|
|
--name fileserver \
|
|
|
|
-p 5412:80 \
|
|
|
|
-v ${{ github.workspace }}/tests/fixtures/pmtiles2:/usr/share/nginx/html \
|
|
|
|
nginx:alpine
|
2023-09-30 07:45:15 +03:00
|
|
|
- name: Build linux/arm64 Docker image
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
# https://github.com/docker/build-push-action
|
|
|
|
with:
|
|
|
|
context: .
|
2023-11-24 05:14:32 +03:00
|
|
|
file: .github/files/multi-platform.Dockerfile
|
2023-09-30 07:45:15 +03:00
|
|
|
load: true
|
|
|
|
tags: ${{ github.repository }}:linux-arm64
|
|
|
|
platforms: linux/arm64
|
|
|
|
- name: Test linux/arm64 Docker image
|
|
|
|
run: |
|
|
|
|
PLATFORM=linux/arm64
|
|
|
|
TAG=${{ github.repository }}:linux-arm64
|
2023-11-19 13:06:37 +03:00
|
|
|
export MARTIN_BUILD_ALL=-
|
2023-09-30 07:45:15 +03:00
|
|
|
export MARTIN_BIN="docker run --rm --net host --platform $PLATFORM -e DATABASE_URL -v $PWD/tests:/tests $TAG"
|
2023-11-20 09:27:51 +03:00
|
|
|
export MARTIN_CP_BIN="docker run --rm --net host --platform $PLATFORM -e DATABASE_URL -v $PWD/tests:/tests --entrypoint /usr/local/bin/martin-cp $TAG"
|
2023-11-19 13:06:37 +03:00
|
|
|
export MBTILES_BIN="docker run --rm --net host --platform $PLATFORM -e DATABASE_URL -v $PWD/tests:/tests --entrypoint /usr/local/bin/mbtiles $TAG"
|
2023-09-30 07:45:15 +03:00
|
|
|
tests/test.sh
|
|
|
|
env:
|
|
|
|
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=require
|
|
|
|
|
|
|
|
- name: Build linux/amd64 Docker image
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
# https://github.com/docker/build-push-action
|
|
|
|
with:
|
|
|
|
context: .
|
2023-11-24 05:14:32 +03:00
|
|
|
file: .github/files/multi-platform.Dockerfile
|
2023-09-30 07:45:15 +03:00
|
|
|
load: true
|
|
|
|
tags: ${{ github.repository }}:linux-amd64
|
|
|
|
platforms: linux/amd64
|
|
|
|
- name: Test linux/amd64 Docker image
|
|
|
|
run: |
|
|
|
|
PLATFORM=linux/amd64
|
|
|
|
TAG=${{ github.repository }}:linux-amd64
|
2023-11-19 13:06:37 +03:00
|
|
|
export MARTIN_BUILD_ALL=-
|
2023-09-30 07:45:15 +03:00
|
|
|
export MARTIN_BIN="docker run --rm --net host --platform $PLATFORM -e DATABASE_URL -v $PWD/tests:/tests $TAG"
|
2023-11-20 09:27:51 +03:00
|
|
|
export MARTIN_CP_BIN="docker run --rm --net host --platform $PLATFORM -e DATABASE_URL -v $PWD/tests:/tests --entrypoint /usr/local/bin/martin-cp $TAG"
|
2023-11-19 13:06:37 +03:00
|
|
|
export MBTILES_BIN="docker run --rm --net host --platform $PLATFORM -e DATABASE_URL -v $PWD/tests:/tests --entrypoint /usr/local/bin/mbtiles $TAG"
|
2023-09-30 07:45:15 +03:00
|
|
|
tests/test.sh
|
|
|
|
env:
|
|
|
|
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=require
|
|
|
|
|
|
|
|
- name: Login to GitHub Docker registry
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
# https://github.com/docker/login-action
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
id: docker_meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
# https://github.com/docker/metadata-action
|
|
|
|
with:
|
|
|
|
images: ghcr.io/${{ github.repository }}
|
|
|
|
- name: Push the Docker image
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
2023-11-24 05:14:32 +03:00
|
|
|
file: .github/files/multi-platform.Dockerfile
|
2023-09-30 07:45:15 +03:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
2022-10-31 23:28:21 +03:00
|
|
|
build:
|
2022-11-19 01:39:44 +03:00
|
|
|
name: Build ${{ matrix.target }}
|
2023-09-26 03:27:55 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-10-31 23:28:21 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
include:
|
2023-09-26 03:27:55 +03:00
|
|
|
- target: aarch64-apple-darwin
|
|
|
|
os: macOS-latest
|
2023-09-26 11:00:39 +03:00
|
|
|
- target: debian-x86_64
|
|
|
|
os: ubuntu-latest
|
2023-09-26 03:27:55 +03:00
|
|
|
- target: x86_64-apple-darwin
|
|
|
|
os: macOS-latest
|
|
|
|
- target: x86_64-pc-windows-msvc
|
|
|
|
os: windows-latest
|
|
|
|
ext: '.exe'
|
|
|
|
- target: x86_64-unknown-linux-gnu
|
|
|
|
os: ubuntu-latest
|
2019-09-29 21:47:24 +03:00
|
|
|
steps:
|
2023-10-12 07:37:03 +03:00
|
|
|
- name: Checkout sources
|
2023-09-05 02:25:16 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-03-25 21:40:23 +03:00
|
|
|
- name: Rust Versions
|
2023-09-26 03:27:55 +03:00
|
|
|
run: rustc --version && cargo --version
|
2023-09-30 06:11:09 +03:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2023-09-30 07:52:08 +03:00
|
|
|
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
|
2023-09-30 06:11:09 +03:00
|
|
|
- name: Build (.deb)
|
2023-09-26 11:00:39 +03:00
|
|
|
if: matrix.target == 'debian-x86_64'
|
2023-07-10 21:38:48 +03:00
|
|
|
run: |
|
2023-10-01 05:49:56 +03:00
|
|
|
set -x
|
2023-09-26 03:27:55 +03:00
|
|
|
sudo apt-get install -y dpkg dpkg-dev liblzma-dev
|
|
|
|
cargo install cargo-deb
|
2023-09-26 11:00:39 +03:00
|
|
|
cargo deb -v -p martin --output target/debian/debian-x86_64.deb
|
|
|
|
mkdir -p target_releases
|
2023-09-30 06:11:09 +03:00
|
|
|
mv target/debian/debian-x86_64.deb target_releases/
|
|
|
|
- name: Build
|
|
|
|
if: matrix.target != 'debian-x86_64'
|
|
|
|
run: |
|
|
|
|
set -x
|
2023-09-30 12:58:49 +03:00
|
|
|
rustup target add "${{ matrix.target }}"
|
2023-09-30 06:11:09 +03:00
|
|
|
export RUSTFLAGS='-C strip=debuginfo'
|
2023-10-28 11:50:49 +03:00
|
|
|
cargo build --release --target ${{ matrix.target }} --package mbtiles
|
2023-09-30 12:58:49 +03:00
|
|
|
cargo build --release --target ${{ matrix.target }} --package martin
|
2023-09-30 06:11:09 +03:00
|
|
|
mkdir -p target_releases
|
|
|
|
mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases/
|
2023-11-20 09:27:51 +03:00
|
|
|
mv target/${{ matrix.target }}/release/martin-cp${{ matrix.ext }} target_releases/
|
|
|
|
mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases/
|
2023-09-26 03:27:55 +03:00
|
|
|
- name: Save build artifacts to build-${{ matrix.target }}
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-10-28 21:52:39 +03:00
|
|
|
with:
|
2022-11-19 01:12:55 +03:00
|
|
|
name: build-${{ matrix.target }}
|
2022-10-31 23:28:21 +03:00
|
|
|
path: target_releases/*
|
2021-10-12 17:56:45 +03:00
|
|
|
|
2023-10-01 05:49:56 +03:00
|
|
|
test-multi-os:
|
|
|
|
name: Test on ${{ matrix.os }}
|
2023-09-26 03:27:55 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-07-04 00:29:44 +03:00
|
|
|
needs: [ build ]
|
2022-10-22 20:39:05 +03:00
|
|
|
strategy:
|
2022-10-31 23:28:21 +03:00
|
|
|
fail-fast: true
|
2022-10-22 20:39:05 +03:00
|
|
|
matrix:
|
|
|
|
include:
|
2023-09-26 03:27:55 +03:00
|
|
|
- target: x86_64-apple-darwin
|
|
|
|
os: macOS-latest
|
|
|
|
- target: x86_64-pc-windows-msvc
|
|
|
|
os: windows-latest
|
2023-06-04 01:54:50 +03:00
|
|
|
ext: '.exe'
|
2023-09-26 03:27:55 +03:00
|
|
|
- target: x86_64-unknown-linux-gnu
|
|
|
|
os: ubuntu-latest
|
2022-10-22 20:39:05 +03:00
|
|
|
steps:
|
2022-10-31 23:28:21 +03:00
|
|
|
- name: Checkout sources
|
2023-09-05 02:25:16 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-12-25 21:44:12 +03:00
|
|
|
# - name: Install Docker (MacOS)
|
|
|
|
# if: runner.os == 'macos'
|
|
|
|
# run: brew install docker && colima start
|
2023-12-22 09:01:50 +03:00
|
|
|
- name: Start HTTP Server (with Docker)
|
2023-12-25 21:44:12 +03:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2023-12-22 09:01:50 +03:00
|
|
|
run: |
|
|
|
|
docker run --rm -d \
|
|
|
|
--name fileserver \
|
|
|
|
-p 5412:80 \
|
|
|
|
-v ${{ github.workspace }}/tests/fixtures/pmtiles2:/usr/share/nginx/html \
|
|
|
|
nginx:alpine
|
2023-12-25 21:44:12 +03:00
|
|
|
- name: Start HTTP Server (MacOS, no Docker)
|
|
|
|
if: runner.os == 'macos'
|
|
|
|
run: |
|
|
|
|
cat << EOF > /usr/local/etc/nginx/nginx.conf
|
|
|
|
worker_processes 1;
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
http {
|
|
|
|
include mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
server {
|
|
|
|
listen 5412;
|
|
|
|
server_name localhost;
|
|
|
|
location / {
|
|
|
|
root $PWD/tests/fixtures/pmtiles2;
|
|
|
|
index index.html index.htm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
brew services info nginx
|
|
|
|
brew services start nginx
|
|
|
|
sleep 2
|
|
|
|
curl -I http://localhost:5412/
|
|
|
|
curl -I http://localhost:5412/webp2.pmtiles
|
|
|
|
|
2023-12-22 09:01:50 +03:00
|
|
|
- name: Start HTTP Server (Windows, no Docker)
|
|
|
|
if: runner.os == 'windows'
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
$nginxConf = @"
|
|
|
|
worker_processes 1;
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
http {
|
|
|
|
include mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
server {
|
|
|
|
listen 5412;
|
|
|
|
server_name localhost;
|
|
|
|
location / {
|
|
|
|
root $($PWD.Path)/tests/fixtures/pmtiles2;
|
|
|
|
index index.html index.htm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
"@
|
|
|
|
|
|
|
|
# Replace the default Nginx configuration file
|
|
|
|
echo "$nginxConf"
|
|
|
|
Set-Content -Path "C:\tools\nginx-1.25.3\conf\nginx.conf" -Value $nginxConf
|
|
|
|
Get-Content -Path "C:\tools\nginx-1.25.3\conf\nginx.conf"
|
|
|
|
|
|
|
|
# Start Nginx
|
|
|
|
#Get-Service -ErrorAction SilentlyContinue
|
|
|
|
#Get-CimInstance -ClassName Win32_Service
|
|
|
|
Set-Service nginx -StartupType manual
|
|
|
|
Start-Service nginx
|
|
|
|
#Start-Process -FilePath "C:\tools\nginx-1.25.3\nginx.exe"
|
|
|
|
dir C:\tools\nginx-1.25.3\logs\
|
|
|
|
Start-Sleep -Seconds 5
|
|
|
|
netstat -a
|
|
|
|
|
|
|
|
# Print Nginx Error Logs (on Windows systems)
|
|
|
|
#nginx -t
|
|
|
|
Get-Content -Path "C:\tools\nginx-1.25.3\logs\error.log"
|
|
|
|
dir D:\a\martin\martin\
|
2022-10-31 23:28:21 +03:00
|
|
|
- name: Start postgres
|
2023-11-22 08:47:18 +03:00
|
|
|
uses: nyurik/action-setup-postgis@v1.1
|
2022-10-31 23:28:21 +03:00
|
|
|
id: pg
|
|
|
|
with:
|
|
|
|
username: test
|
|
|
|
password: test
|
|
|
|
database: test
|
|
|
|
rights: --superuser
|
2023-09-26 03:27:55 +03:00
|
|
|
- name: Init database
|
2022-12-12 17:11:10 +03:00
|
|
|
run: |
|
|
|
|
echo "DATABASE_URL=$DATABASE_URL"
|
2023-09-26 03:27:55 +03:00
|
|
|
echo "Print the same in base64 to bypass Github's obfuscation (uses hardcoded password):"
|
2022-12-12 17:11:10 +03:00
|
|
|
echo "$DATABASE_URL" | base64
|
2023-09-26 03:27:55 +03:00
|
|
|
tests/fixtures/initdb.sh
|
2022-10-31 23:28:21 +03:00
|
|
|
env:
|
|
|
|
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
|
2023-09-26 20:29:22 +03:00
|
|
|
- name: Download build artifact build-${{ matrix.target }}
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2022-10-31 23:28:21 +03:00
|
|
|
with:
|
2022-11-19 01:12:55 +03:00
|
|
|
name: build-${{ matrix.target }}
|
2022-10-31 23:28:21 +03:00
|
|
|
path: target/
|
2022-12-12 17:11:10 +03:00
|
|
|
- name: Integration Tests
|
2022-10-31 23:28:21 +03:00
|
|
|
run: |
|
2023-11-19 13:06:37 +03:00
|
|
|
export MARTIN_BUILD_ALL=-
|
2023-09-26 03:27:55 +03:00
|
|
|
export MARTIN_BIN=target/martin${{ matrix.ext }}
|
2023-11-20 09:27:51 +03:00
|
|
|
export MARTIN_CP_BIN=target/martin-cp${{ matrix.ext }}
|
2023-09-26 03:27:55 +03:00
|
|
|
export MBTILES_BIN=target/mbtiles${{ matrix.ext }}
|
2022-10-31 23:28:21 +03:00
|
|
|
if [[ "${{ runner.os }}" != "Windows" ]]; then
|
2023-11-20 09:27:51 +03:00
|
|
|
chmod +x "$MARTIN_BIN" "$MARTIN_CP_BIN" "$MBTILES_BIN"
|
2022-10-31 23:28:21 +03:00
|
|
|
fi
|
|
|
|
tests/test.sh
|
|
|
|
env:
|
|
|
|
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
|
2023-09-26 11:00:39 +03:00
|
|
|
- name: Compare test output results (Linux)
|
|
|
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
|
|
|
run: diff --brief --recursive --new-file tests/output tests/expected
|
|
|
|
- name: Download Debian package (Linux)
|
|
|
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-09-26 11:00:39 +03:00
|
|
|
with:
|
|
|
|
name: build-debian-x86_64
|
|
|
|
path: target/
|
|
|
|
- name: Tests Debian package (Linux)
|
2023-07-10 21:38:48 +03:00
|
|
|
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
|
|
|
run: |
|
2023-09-26 11:00:39 +03:00
|
|
|
sudo dpkg -i target/debian-x86_64.deb
|
2023-11-19 13:06:37 +03:00
|
|
|
export MARTIN_BUILD_ALL=-
|
2023-09-26 11:00:39 +03:00
|
|
|
export MARTIN_BIN=/usr/bin/martin${{ matrix.ext }}
|
2023-11-20 09:27:51 +03:00
|
|
|
export MARTIN_CP_BIN=/usr/bin/martin-cp${{ matrix.ext }}
|
2023-09-27 21:02:39 +03:00
|
|
|
export MBTILES_BIN=/usr/bin/mbtiles${{ matrix.ext }}
|
2023-07-10 21:38:48 +03:00
|
|
|
tests/test.sh
|
|
|
|
env:
|
|
|
|
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
|
2023-12-22 09:01:50 +03:00
|
|
|
- name: Save test output (on error)
|
2023-10-28 08:23:36 +03:00
|
|
|
if: failure()
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-01-01 08:03:21 +03:00
|
|
|
with:
|
2023-10-28 08:23:36 +03:00
|
|
|
name: failed-test-output-${{ runner.os }}
|
2023-10-28 09:06:37 +03:00
|
|
|
path: |
|
|
|
|
tests/output/*
|
|
|
|
target/test_logs/*
|
2023-01-01 08:03:21 +03:00
|
|
|
retention-days: 5
|
|
|
|
|
2023-10-01 05:49:56 +03:00
|
|
|
test-with-svc:
|
|
|
|
name: Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }}
|
2023-01-01 08:03:21 +03:00
|
|
|
runs-on: ubuntu-latest
|
2023-09-26 03:27:55 +03:00
|
|
|
needs: [ build ]
|
2023-01-01 08:03:21 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# These must match the versions of postgres used in the docker-compose.yml
|
2023-10-01 05:49:56 +03:00
|
|
|
- img_ver: 11-3.0-alpine
|
2023-02-06 22:32:28 +03:00
|
|
|
args: postgres
|
|
|
|
sslmode: disable
|
2023-10-01 05:49:56 +03:00
|
|
|
- img_ver: 14-3.3-alpine
|
2023-02-06 22:32:28 +03:00
|
|
|
args: postgres
|
|
|
|
sslmode: disable
|
|
|
|
# alpine images don't support SSL, so for this we use the debian images
|
2023-10-01 05:49:56 +03:00
|
|
|
- img_ver: 15-3.3
|
2023-02-06 22:32:28 +03:00
|
|
|
args: postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
|
|
|
sslmode: require
|
2023-10-01 05:49:56 +03:00
|
|
|
#
|
|
|
|
# FIXME!
|
|
|
|
# DISABLED because Rustls fails to validate name (CN?) with the NotValidForName error
|
|
|
|
#- img_ver: 15-3.3
|
|
|
|
# args: postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
|
|
|
# sslmode: verify-ca
|
|
|
|
#- img_ver: 15-3.3
|
|
|
|
# args: postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
|
|
|
# sslmode: verify-full
|
2023-01-01 08:03:21 +03:00
|
|
|
env:
|
|
|
|
PGDATABASE: test
|
|
|
|
PGHOST: localhost
|
|
|
|
PGUSER: postgres
|
2023-02-06 22:32:28 +03:00
|
|
|
PGPASSWORD: postgres
|
2023-01-01 08:03:21 +03:00
|
|
|
services:
|
|
|
|
postgres:
|
2023-10-01 05:49:56 +03:00
|
|
|
image: postgis/postgis:${{ matrix.img_ver }}
|
2023-01-01 08:03:21 +03:00
|
|
|
ports:
|
|
|
|
- 5432/tcp
|
2023-02-06 22:32:28 +03:00
|
|
|
options: >-
|
|
|
|
-e POSTGRES_DB=test
|
|
|
|
-e POSTGRES_USER=postgres
|
|
|
|
-e POSTGRES_PASSWORD=postgres
|
|
|
|
-e PGDATABASE=test
|
|
|
|
-e PGUSER=postgres
|
|
|
|
-e PGPASSWORD=postgres
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
--entrypoint sh
|
2023-10-01 05:49:56 +03:00
|
|
|
postgis/postgis:${{ matrix.img_ver }}
|
2023-02-06 22:32:28 +03:00
|
|
|
-c "exec docker-entrypoint.sh ${{ matrix.args }}"
|
2023-01-01 08:03:21 +03:00
|
|
|
steps:
|
2023-07-04 00:29:44 +03:00
|
|
|
- name: Checkout sources
|
2023-09-05 02:25:16 +03:00
|
|
|
uses: actions/checkout@v4
|
2023-09-30 06:11:09 +03:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2023-09-30 07:52:08 +03:00
|
|
|
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
|
2023-12-22 09:01:50 +03:00
|
|
|
- name: Start HTTP Server
|
|
|
|
run: |
|
|
|
|
docker run --rm -d \
|
|
|
|
--name fileserver \
|
|
|
|
-p 5412:80 \
|
|
|
|
-v ${{ github.workspace }}/tests/fixtures/pmtiles2:/usr/share/nginx/html \
|
|
|
|
nginx:alpine
|
2023-10-01 05:49:56 +03:00
|
|
|
- name: Init database
|
2023-09-27 21:02:39 +03:00
|
|
|
run: tests/fixtures/initdb.sh
|
2023-07-04 00:29:44 +03:00
|
|
|
env:
|
|
|
|
PGPORT: ${{ job.services.postgres.ports[5432] }}
|
2023-10-01 05:49:56 +03:00
|
|
|
- name: Get DB SSL cert (sslmode=verify-*)
|
|
|
|
if: matrix.sslmode == 'verify-ca' || matrix.sslmode == 'verify-full'
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
mkdir -p target/certs
|
|
|
|
docker cp ${{ job.services.postgres.id }}:/etc/ssl/certs/ssl-cert-snakeoil.pem target/certs/server.crt
|
|
|
|
docker cp ${{ job.services.postgres.id }}:/etc/ssl/private/ssl-cert-snakeoil.key target/certs/server.key
|
2023-09-27 21:02:39 +03:00
|
|
|
- name: Download build artifact build-x86_64-unknown-linux-gnu
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-09-27 21:02:39 +03:00
|
|
|
with:
|
|
|
|
name: build-x86_64-unknown-linux-gnu
|
|
|
|
path: target_releases/
|
|
|
|
- name: Integration Tests
|
|
|
|
run: |
|
2023-10-01 05:49:56 +03:00
|
|
|
if [[ "${{ matrix.sslmode }}" == "verify-ca" || "${{ matrix.sslmode }}" == "verify-full" ]]; then
|
|
|
|
export PGSSLROOTCERT=target/certs/server.crt
|
|
|
|
fi
|
2023-11-19 13:06:37 +03:00
|
|
|
export MARTIN_BUILD_ALL=-
|
2023-09-27 21:02:39 +03:00
|
|
|
export MARTIN_BIN=target_releases/martin
|
2023-11-20 09:27:51 +03:00
|
|
|
export MARTIN_CP_BIN=target_releases/martin-cp
|
2023-09-27 21:02:39 +03:00
|
|
|
export MBTILES_BIN=target_releases/mbtiles
|
2023-11-20 09:27:51 +03:00
|
|
|
chmod +x "$MARTIN_BIN" "$MARTIN_CP_BIN" "$MBTILES_BIN"
|
2023-09-27 21:02:39 +03:00
|
|
|
tests/test.sh
|
|
|
|
rm -rf target_releases
|
|
|
|
env:
|
|
|
|
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=${{ matrix.sslmode }}
|
|
|
|
- name: Download Debian package
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-09-27 21:02:39 +03:00
|
|
|
with:
|
|
|
|
name: build-debian-x86_64
|
|
|
|
path: target_releases/
|
|
|
|
- name: Tests Debian package
|
|
|
|
run: |
|
|
|
|
sudo dpkg -i target_releases/debian-x86_64.deb
|
2023-10-01 05:49:56 +03:00
|
|
|
if [[ "${{ matrix.sslmode }}" == "verify-ca" || "${{ matrix.sslmode }}" == "verify-full" ]]; then
|
|
|
|
export PGSSLROOTCERT=target/certs/server.crt
|
|
|
|
fi
|
2023-11-19 13:06:37 +03:00
|
|
|
export MARTIN_BUILD_ALL=-
|
2023-09-27 21:02:39 +03:00
|
|
|
export MARTIN_BIN=/usr/bin/martin
|
2023-11-20 09:27:51 +03:00
|
|
|
export MARTIN_CP_BIN=/usr/bin/martin-cp
|
2023-09-27 21:02:39 +03:00
|
|
|
export MBTILES_BIN=/usr/bin/mbtiles
|
|
|
|
tests/test.sh
|
|
|
|
sudo dpkg -P martin
|
|
|
|
rm -rf target_releases
|
|
|
|
env:
|
|
|
|
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=${{ matrix.sslmode }}
|
|
|
|
- name: Unit Tests
|
2023-10-01 05:49:56 +03:00
|
|
|
if: matrix.sslmode != 'verify-ca' && matrix.sslmode != 'verify-full'
|
2023-07-04 00:29:44 +03:00
|
|
|
run: |
|
|
|
|
echo "Running unit tests, connecting to DATABASE_URL=$DATABASE_URL"
|
|
|
|
echo "Same but as base64 to prevent GitHub obfuscation (this is not a secret):"
|
|
|
|
echo "$DATABASE_URL" | base64
|
|
|
|
set -x
|
2023-09-30 03:40:32 +03:00
|
|
|
cargo test --package martin
|
2023-09-27 21:02:39 +03:00
|
|
|
cargo clean
|
2023-07-04 00:29:44 +03:00
|
|
|
env:
|
|
|
|
DATABASE_URL: postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=${{ matrix.sslmode }}
|
2023-12-22 09:01:50 +03:00
|
|
|
- name: Save test output (on error)
|
2023-07-04 00:29:44 +03:00
|
|
|
if: failure()
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-07-04 00:29:44 +03:00
|
|
|
with:
|
|
|
|
name: test-output
|
2023-10-28 09:06:37 +03:00
|
|
|
path: |
|
|
|
|
tests/output/*
|
|
|
|
target/test_logs/*
|
2023-07-04 00:29:44 +03:00
|
|
|
retention-days: 5
|
2023-09-26 03:27:55 +03:00
|
|
|
|
|
|
|
package:
|
2023-10-12 07:37:03 +03:00
|
|
|
name: Package
|
|
|
|
runs-on: ubuntu-latest
|
2023-10-01 05:49:56 +03:00
|
|
|
needs: [ lint-debug-test, docker-build-test, test-multi-os, test-with-svc ]
|
2023-09-26 03:27:55 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v4
|
2023-10-12 07:37:03 +03:00
|
|
|
- name: Download build artifact build-aarch64-apple-darwin
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-09-26 03:27:55 +03:00
|
|
|
with:
|
2023-10-12 07:37:03 +03:00
|
|
|
name: build-aarch64-apple-darwin
|
|
|
|
path: target/aarch64-apple-darwin
|
|
|
|
- name: Download build artifact build-x86_64-apple-darwin
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-10-12 07:37:03 +03:00
|
|
|
with:
|
|
|
|
name: build-x86_64-apple-darwin
|
|
|
|
path: target/x86_64-apple-darwin
|
|
|
|
- name: Download build artifact build-x86_64-unknown-linux-gnu
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-10-12 07:37:03 +03:00
|
|
|
with:
|
|
|
|
name: build-x86_64-unknown-linux-gnu
|
|
|
|
path: target/x86_64-unknown-linux-gnu
|
|
|
|
|
|
|
|
- name: Download cross-build artifacts
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-09-30 06:11:09 +03:00
|
|
|
with:
|
2023-09-30 07:45:15 +03:00
|
|
|
name: cross-build
|
2023-10-12 07:37:03 +03:00
|
|
|
path: target/cross
|
|
|
|
|
|
|
|
- name: Download build artifact build-x86_64-pc-windows-msvc
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-10-12 07:37:03 +03:00
|
|
|
with:
|
|
|
|
name: build-x86_64-pc-windows-msvc
|
|
|
|
path: target/x86_64-pc-windows-msvc
|
|
|
|
- name: Download build artifact build-debian-x86_64
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/download-artifact@v3
|
2023-10-12 07:37:03 +03:00
|
|
|
with:
|
|
|
|
name: build-debian-x86_64
|
|
|
|
path: target/debian-x86_64
|
|
|
|
|
2023-09-26 03:27:55 +03:00
|
|
|
- name: Package
|
|
|
|
run: |
|
2023-10-12 07:37:03 +03:00
|
|
|
set -x
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
cd target
|
|
|
|
mkdir files
|
|
|
|
mv cross/* .
|
|
|
|
|
|
|
|
cd aarch64-apple-darwin
|
2023-11-20 11:03:42 +03:00
|
|
|
chmod +x martin martin-cp mbtiles
|
|
|
|
tar czvf ../files/martin-aarch64-apple-darwin.tar.gz martin martin-cp mbtiles
|
2023-10-12 07:37:03 +03:00
|
|
|
cd ..
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
cd x86_64-apple-darwin
|
2023-11-20 11:03:42 +03:00
|
|
|
chmod +x martin martin-cp mbtiles
|
|
|
|
tar czvf ../files/martin-x86_64-apple-darwin.tar.gz martin martin-cp mbtiles
|
2023-10-12 07:37:03 +03:00
|
|
|
cd ..
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
cd x86_64-unknown-linux-gnu
|
2023-11-20 11:03:42 +03:00
|
|
|
chmod +x martin martin-cp mbtiles
|
|
|
|
tar czvf ../files/martin-x86_64-unknown-linux-gnu.tar.gz martin martin-cp mbtiles
|
2023-10-12 07:37:03 +03:00
|
|
|
cd ..
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
cd aarch64-unknown-linux-musl
|
2023-11-20 11:03:42 +03:00
|
|
|
chmod +x martin martin-cp mbtiles
|
|
|
|
tar czvf ../files/martin-aarch64-unknown-linux-musl.tar.gz martin martin-cp mbtiles
|
2023-10-12 07:37:03 +03:00
|
|
|
cd ..
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
cd x86_64-unknown-linux-musl
|
2023-11-20 11:03:42 +03:00
|
|
|
chmod +x martin martin-cp mbtiles
|
|
|
|
tar czvf ../files/martin-x86_64-unknown-linux-musl.tar.gz martin martin-cp mbtiles
|
2023-10-12 07:37:03 +03:00
|
|
|
cd ..
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
#
|
2023-10-31 07:56:13 +03:00
|
|
|
# Special case for Windows
|
2023-10-12 07:37:03 +03:00
|
|
|
#
|
|
|
|
cd x86_64-pc-windows-msvc
|
2023-11-20 11:03:42 +03:00
|
|
|
7z a ../files/martin-x86_64-pc-windows-msvc.zip martin.exe martin-cp.exe mbtiles.exe
|
2023-10-12 07:37:03 +03:00
|
|
|
cd ..
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
#
|
|
|
|
# Special case for Debian .deb package
|
|
|
|
#
|
|
|
|
cd debian-x86_64
|
|
|
|
mv debian-x86_64.deb ../files/martin-Debian-x86_64.deb
|
|
|
|
cd ..
|
|
|
|
|
2023-10-12 08:14:18 +03:00
|
|
|
- name: Create Homebrew config
|
2023-10-12 07:44:02 +03:00
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# Extract Github release version only without the "v" prefix
|
|
|
|
MARTIN_VERSION=$(echo "${{ github.ref }}" | sed -e 's/refs\/tags\/v//')
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 22:24:53 +03:00
|
|
|
mkdir -p target/homebrew
|
2023-10-12 07:44:02 +03:00
|
|
|
cd target
|
2023-12-22 03:04:51 +03:00
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
cat << EOF > homebrew_config.yaml
|
2023-10-12 07:44:02 +03:00
|
|
|
version: "$MARTIN_VERSION"
|
2023-11-18 11:22:29 +03:00
|
|
|
macos_arm_sha256: "$(shasum -a 256 files/martin-aarch64-apple-darwin.tar.gz | cut -d' ' -f1)"
|
|
|
|
macos_intel_sha256: "$(shasum -a 256 files/martin-x86_64-apple-darwin.tar.gz | cut -d' ' -f1)"
|
|
|
|
linux_arm_sha256: "$(shasum -a 256 files/martin-aarch64-unknown-linux-musl.tar.gz | cut -d' ' -f1)"
|
|
|
|
linux_intel_sha256: "$(shasum -a 256 files/martin-x86_64-unknown-linux-musl.tar.gz | cut -d' ' -f1)"
|
2023-10-12 07:44:02 +03:00
|
|
|
EOF
|
2023-10-12 07:37:03 +03:00
|
|
|
|
2023-10-12 22:24:53 +03:00
|
|
|
- name: Save Homebrew Config
|
2023-12-16 21:04:16 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-10-12 22:24:53 +03:00
|
|
|
with:
|
|
|
|
name: homebrew-config
|
|
|
|
path: target/homebrew_config.yaml
|
|
|
|
|
2023-09-26 03:27:55 +03:00
|
|
|
- name: Publish
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
draft: true
|
2023-10-12 07:37:03 +03:00
|
|
|
files: 'target/files/*'
|
2023-09-26 03:27:55 +03:00
|
|
|
body_path: CHANGELOG.md
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-10-12 07:37:03 +03:00
|
|
|
- name: Checkout maplibre/homebrew-martin
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: maplibre/homebrew-martin
|
2023-10-12 10:09:02 +03:00
|
|
|
token: ${{ secrets.GH_HOMEBREW_MARTIN_TOKEN }}
|
2023-10-12 07:37:03 +03:00
|
|
|
path: target/homebrew
|
|
|
|
|
|
|
|
- name: Create Homebrew formula
|
2023-11-10 07:11:01 +03:00
|
|
|
uses: cuchi/jinja2-action@master
|
2023-10-12 07:37:03 +03:00
|
|
|
with:
|
2023-11-24 05:14:32 +03:00
|
|
|
template: .github/files/homebrew.martin.rb.j2
|
2023-10-12 07:37:03 +03:00
|
|
|
output_file: target/homebrew/martin.rb
|
|
|
|
data_file: target/homebrew_config.yaml
|
|
|
|
|
|
|
|
- name: Create a PR for maplibre/homebrew-martin
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
chore(deps): Bump peter-evans/create-pull-request from 5 to 6 (#1168)
Bumps
[peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request)
from 5 to 6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/peter-evans/create-pull-request/releases">peter-evans/create-pull-request's
releases</a>.</em></p>
<blockquote>
<h2>Create Pull Request v6.0.0</h2>
<h2>Behaviour changes</h2>
<ul>
<li>The default values for <code>author</code> and
<code>committer</code> have changed. See "What's new" below
for details. If you are overriding the default values you will not be
affected by this change.</li>
<li>On completion, the action now removes the temporary git remote
configuration it adds when using <code>push-to-fork</code>. This should
not affect you unless you were using the temporary configuration for
some other purpose after the action completes.</li>
</ul>
<h2>What's new</h2>
<ul>
<li>Updated runtime to Node.js 20
<ul>
<li>The action now requires a minimum version of <a
href="https://github.com/actions/runner/releases/tag/v2.308.0">v2.308.0</a>
for the Actions runner. Update self-hosted runners to v2.308.0 or later
to ensure compatibility.</li>
</ul>
</li>
<li>The default value for <code>author</code> has been changed to
<code>${{ github.actor }} <${{ github.actor_id }}+${{ github.actor
}}@users.noreply.github.com></code>. The change adds the <code>${{
github.actor_id }}+</code> prefix to the email address to align with
GitHub's standard format for the author email address.</li>
<li>The default value for <code>committer</code> has been changed to
<code>github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com></code>.
This is to align with the default GitHub Actions bot user account.</li>
<li>Adds input <code>git-token</code>, the <a
href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">Personal
Access Token (PAT)</a> that the action will use for git operations. This
input defaults to the value of <code>token</code>. Use this input if you
would like the action to use a different token for git operations than
the one used for the GitHub API.</li>
<li><code>push-to-fork</code> now supports pushing to sibling
repositories in the same network.</li>
<li>Previously, when using <code>push-to-fork</code>, the action did not
remove temporary git remote configuration it adds during execution. This
has been fixed and the configuration is now removed when the action
completes.</li>
<li>If the pull request body is truncated due to exceeding the maximum
length, the action will now suffix the body with the message
"...<em>[Pull request body truncated]</em>" to indicate that
the body has been truncated.</li>
<li>The action now uses <code>--unshallow</code> only when necessary,
rather than as a default argument of <code>git fetch</code>. This should
improve performance, particularly for large git repositories with
extensive commit history.</li>
<li>The action can now be executed on one GitHub server and create pull
requests on a <em>different</em> GitHub server. Server products include
GitHub hosted (github.com), GitHub Enterprise Server (GHES), and GitHub
Enterprise Cloud (GHEC). For example, the action can be executed on
GitHub hosted and create pull requests on a GHES or GHEC instance.</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>Update distribution by <a
href="https://github.com/actions-bot"><code>@actions-bot</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2086">peter-evans/create-pull-request#2086</a></li>
<li>fix crazy-max/ghaction-import-gp parameters by <a
href="https://github.com/fharper"><code>@fharper</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2177">peter-evans/create-pull-request#2177</a></li>
<li>Update distribution by <a
href="https://github.com/actions-bot"><code>@actions-bot</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2364">peter-evans/create-pull-request#2364</a></li>
<li>Use checkout v4 by <a
href="https://github.com/okuramasafumi"><code>@okuramasafumi</code></a>
in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2521">peter-evans/create-pull-request#2521</a></li>
<li>Note about <code>delete-branch</code> by <a
href="https://github.com/dezren39"><code>@dezren39</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2631">peter-evans/create-pull-request#2631</a></li>
<li>98 dependency updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/fharper"><code>@fharper</code></a> made
their first contribution in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2177">peter-evans/create-pull-request#2177</a></li>
<li><a
href="https://github.com/okuramasafumi"><code>@okuramasafumi</code></a>
made their first contribution in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2521">peter-evans/create-pull-request#2521</a></li>
<li><a href="https://github.com/dezren39"><code>@dezren39</code></a>
made their first contribution in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2631">peter-evans/create-pull-request#2631</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/peter-evans/create-pull-request/compare/v5.0.2...v6.0.0">https://github.com/peter-evans/create-pull-request/compare/v5.0.2...v6.0.0</a></p>
<h2>Create Pull Request v5.0.2</h2>
<p>⚙️ Fixes an issue that occurs when using <code>push-to-fork</code>
and both base and head repositories are in the same org/user
account.</p>
<h2>What's Changed</h2>
<ul>
<li>fix: specify head repo by <a
href="https://github.com/peter-evans"><code>@peter-evans</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/2044">peter-evans/create-pull-request#2044</a></li>
<li>20 dependency updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/peter-evans/create-pull-request/compare/v5.0.1...v5.0.2">https://github.com/peter-evans/create-pull-request/compare/v5.0.1...v5.0.2</a></p>
<h2>Create Pull Request v5.0.1</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: truncate body if exceeds max length by <a
href="https://github.com/peter-evans"><code>@peter-evans</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/1915">peter-evans/create-pull-request#1915</a></li>
<li>12 dependency updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/peter-evans/create-pull-request/compare/v5.0.0...v5.0.1">https://github.com/peter-evans/create-pull-request/compare/v5.0.0...v5.0.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/b1ddad2c994a25fbc81a28b3ec0e368bb2021c50"><code>b1ddad2</code></a>
feat: v6 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2717">#2717</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/bb809027fda03cc267431a7d36a88148eb9f3846"><code>bb80902</code></a>
build(deps-dev): bump <code>@types/node</code> from 18.19.8 to 18.19.10
(<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2712">#2712</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/e0037d470cdeb1c8133acfba89af08639bb69eb3"><code>e0037d4</code></a>
build(deps): bump peter-evans/create-or-update-comment from 3 to 4 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2702">#2702</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/94b1f99e3a73880074d0e669c3b69d376cc8ceae"><code>94b1f99</code></a>
build(deps): bump peter-evans/find-comment from 2 to 3 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2703">#2703</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/69c27eaf4a14a67b5362a51e681f83d3d5e0f96b"><code>69c27ea</code></a>
build(deps-dev): bump ts-jest from 29.1.1 to 29.1.2 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2685">#2685</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/7ea722a0f6286a45eb3005280d83575a74bc8fef"><code>7ea722a</code></a>
build(deps-dev): bump prettier from 3.2.2 to 3.2.4 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2684">#2684</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/5ee839affd4c87811108724370a2819a40e2e5d3"><code>5ee839a</code></a>
build(deps-dev): bump <code>@types/node</code> from 18.19.7 to 18.19.8
(<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2683">#2683</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/60fc256c678e6ed78d0d42e09675c9beba09cb94"><code>60fc256</code></a>
build(deps-dev): bump eslint-plugin-prettier from 5.1.2 to 5.1.3 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2660">#2660</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/0c677233614c017442253060c74fd2cb7ff349fc"><code>0c67723</code></a>
build(deps-dev): bump <code>@types/node</code> from 18.19.5 to 18.19.7
(<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2661">#2661</a>)</li>
<li><a
href="https://github.com/peter-evans/create-pull-request/commit/4e288e851b95bd1362e281a255094fcc47ada675"><code>4e288e8</code></a>
build(deps-dev): bump prettier from 3.1.1 to 3.2.2 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/2659">#2659</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/peter-evans/create-pull-request/compare/v5...v6">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=peter-evans/create-pull-request&package-manager=github_actions&previous-version=5&new-version=6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 02:23:10 +03:00
|
|
|
uses: peter-evans/create-pull-request@v6
|
2023-10-12 07:37:03 +03:00
|
|
|
with:
|
2023-10-12 22:58:52 +03:00
|
|
|
# Create a personal access token
|
|
|
|
# Gen: https://github.com/settings/personal-access-tokens/new
|
|
|
|
# Set: https://github.com/maplibre/martin/settings/secrets/actions/GH_HOMEBREW_MARTIN_TOKEN
|
|
|
|
# Docs: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token
|
|
|
|
# Name: anything descriptive
|
|
|
|
# One year long (sadly that's max)
|
|
|
|
# Repository owner and repo: maplibre/homebrew-martin
|
|
|
|
# Access Contents: Read and write
|
2023-10-12 22:24:53 +03:00
|
|
|
# Access Metadata: Read-only
|
|
|
|
# Access Pull requests: Read and write
|
2023-10-12 09:02:03 +03:00
|
|
|
token: ${{ secrets.GH_HOMEBREW_MARTIN_TOKEN }}
|
2023-12-22 03:04:51 +03:00
|
|
|
commit-message: 'Update to ${{ github.ref }}'
|
|
|
|
title: 'Update to ${{ github.ref }}'
|
|
|
|
body: 'Update to ${{ github.ref }}'
|
|
|
|
branch: 'update-to-${{ github.ref }}'
|
2023-10-12 07:37:03 +03:00
|
|
|
branch-suffix: timestamp
|
2023-12-22 03:04:51 +03:00
|
|
|
base: 'main'
|
|
|
|
labels: 'auto-update'
|
|
|
|
assignees: 'nyurik'
|
2023-10-12 07:37:03 +03:00
|
|
|
draft: false
|
|
|
|
delete-branch: true
|
|
|
|
path: target/homebrew
|
|
|
|
|
2023-09-26 03:27:55 +03:00
|
|
|
# This final step is needed to mark the whole workflow as successful
|
|
|
|
# Don't change its name - it is used by the merge protection rules
|
|
|
|
done:
|
|
|
|
name: CI Finished
|
|
|
|
runs-on: ubuntu-latest
|
2023-09-30 07:45:15 +03:00
|
|
|
needs: [ package ]
|
2023-09-26 03:27:55 +03:00
|
|
|
steps:
|
|
|
|
- name: Finished
|
|
|
|
run: echo "CI finished successfully"
|