Skip to content

Commit

Permalink
add debian package
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkAndshark committed Jul 10, 2023
1 parent 5f5d891 commit 2a6c7f5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ 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 dpkg -y
sudo apt install dpkg-dev -y
sudo apt install liblzma-dev -y
cargo install cargo-deb
- name: Run build
shell: bash
run: |
Expand All @@ -82,6 +89,12 @@ jobs:
mv target/${{ matrix.target }}/release/martin target_releases
mv target/${{ matrix.target }}/release/mbtiles target_releases
fi
- name: 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 @@ -156,7 +169,7 @@ jobs:
with:
name: build-${{ matrix.target }}
path: target/
- name: Integration Tests
- name: Integration Tests (without debian package)
if: matrix.target != 'aarch64-apple-darwin'
shell: bash
run: |
Expand All @@ -171,7 +184,18 @@ jobs:
MARTIN_BIN: target/martin${{ matrix.ext }}
MBTILES_BUILD: "-"
MBTILES_BIN: target/mbtiles${{ matrix.ext }}

- name: Integration Tests (with debian package)
if: matrix.os == 'ubuntu-latest'
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 +221,13 @@ jobs:
tar czvf ../${{ matrix.name }} martin${{ matrix.ext }} mbtiles${{ matrix.ext }}
fi
cd -
- name: package (debian)
if: matrix.os == 'ubuntu-latest'
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

0 comments on commit 2a6c7f5

Please sign in to comment.