Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian package #730

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions martin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>, Yuri Astrakhan <[email protected]>, MapLibre contributors"
depends = "$auto"

[lib]
path = "src/lib.rs"
Expand Down
Loading