diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54d6da818..24f38e03e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,11 @@ jobs: run: | echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append vcpkg install openssl:x64-windows-static-md + - name: Install cargo-deb + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y dpkg dpkg-dev liblzma-dev + cargo install cargo-deb - name: Run build shell: bash run: | @@ -82,6 +87,12 @@ jobs: mv target/${{ matrix.target }}/release/martin target_releases mv target/${{ matrix.target }}/release/mbtiles target_releases fi + - name: Run build (debian package) + if: matrix.os == 'ubuntu-latest' + shell: bash + run: | + cargo deb -v -p martin --output target/debian/martin.deb + mv target/debian/martin.deb target_releases - name: Save build artifact build-${{ matrix.target }} uses: actions/upload-artifact@v3 with: @@ -171,7 +182,18 @@ jobs: MARTIN_BIN: target/martin${{ matrix.ext }} MBTILES_BUILD: "-" MBTILES_BIN: target/mbtiles${{ matrix.ext }} - + - name: Integration Tests (with debian package) + if: matrix.target == 'x86_64-unknown-linux-gnu' + shell: bash + run: | + sudo dpkg -i target/martin.deb + tests/test.sh + env: + DATABASE_URL: ${{ steps.pg.outputs.connection-uri }} + MARTIN_BUILD: "-" + MARTIN_BIN: /usr/bin/martin + MBTILES_BUILD: "-" + MBTILES_BIN: target/mbtiles${{ matrix.ext }} - name: Compare test output results (Linux) if: matrix.target == 'x86_64-unknown-linux-gnu' run: diff --brief --recursive --new-file tests/output tests/expected @@ -197,6 +219,13 @@ jobs: tar czvf ../${{ matrix.name }} martin${{ matrix.ext }} mbtiles${{ matrix.ext }} fi cd - + - name: Package (debian) + if: matrix.target == 'x86_64-unknown-linux-gnu' + shell: bash + run: | + cd target/ + tar czvf ../martin-debian-x86_64.tar.gz martin.deb + cd - - name: Generate SHA-256 (MacOS) if: matrix.target == 'x86_64-apple-darwin' || matrix.target == 'aarch64-apple-darwin' run: shasum -a 256 ${{ matrix.name }} diff --git a/Cargo.toml b/Cargo.toml index 6e17d54d9..a94dbbc33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,8 @@ edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/maplibre/martin" rust-version = "1.65" +readme = "README.md" +homepage = "https://martin.maplibre.org/" [workspace.dependencies] actix = "0.13" diff --git a/justfile b/justfile index 2360293a0..9198c252e 100644 --- a/justfile +++ b/justfile @@ -110,6 +110,10 @@ bless: start clean-test book: (cargo-install "mdbook") mdbook serve docs --open --port 8321 +# Build debian package +package-deb: (cargo-install "cargo-deb") + cargo deb -v -p martin --output target/debian/martin.deb + # Build and open code documentation docs: cargo doc --no-deps --open diff --git a/martin/Cargo.toml b/martin/Cargo.toml index 8b603d9ba..a11c2a932 100644 --- a/martin/Cargo.toml +++ b/martin/Cargo.toml @@ -13,6 +13,13 @@ edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true +readme.workspace = true +homepage.workspace = true + +[package.metadata.deb] +name = "martin" +maintainer = "Stepan Kuzmin , Yuri Astrakhan , MapLibre contributors" +depends = "$auto" [lib] path = "src/lib.rs"