From f612b5953131156fa7f3efe72c6441994fdc2a2f Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 18:46:22 -0400 Subject: [PATCH 1/8] mbtiles: remove tls features, CI streamlining --- martin/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/martin/Cargo.toml b/martin/Cargo.toml index 6eb70d11e..cdad449dc 100644 --- a/martin/Cargo.toml +++ b/martin/Cargo.toml @@ -70,7 +70,7 @@ futures.workspace = true itertools.workspace = true json-patch.workspace = true log.workspace = true -martin-mbtiles.workspace = true +martin-mbtiles = { workspace = true, default-features = false } martin-tile-utils.workspace = true num_cpus.workspace = true pmtiles.workspace = true From 0b77eaf197374c63d8c6d3681f4985be84c24ef5 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 18:46:22 -0400 Subject: [PATCH 2/8] wip --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7a8c6d94..933add1b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,9 @@ jobs: - target: aarch64-unknown-linux-gnu os: ubuntu-latest cross: 'true' + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + cross: 'true' - target: debian-x86_64 os: ubuntu-latest cross: 'true' From 663fe8b402ed7acb4953cc4126a268887e347a9c Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 18:46:37 -0400 Subject: [PATCH 3/8] wip2 --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 933add1b2..e0e129add 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,6 +94,18 @@ jobs: export RUSTFLAGS='-C link-arg=-s -C linker=aarch64-linux-gnu-gcc' cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl cargo build --release --target ${{ matrix.target }} --package martin-mbtiles + - name: Build (cross - aarch64-unknown-linux-musl) + if: matrix.target == 'aarch64-unknown-linux-musl' + run: | + + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS='-C link-arg=-s' cross build --target aarch64-unknown-linux-musl --package martin-mbtiles + + # sudo apt-get install -y gcc-aarch64-linux-musl binutils-aarch64-linux-musl + rustup target add "${{ matrix.target }}" + # compile without debug symbols because stripping them with `strip` does not work cross-platform + export RUSTFLAGS='-C link-arg=-s -C linker=aarch64-linux-musl-gcc' + cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl + cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - name: Build (debian package) if: matrix.target == 'debian-x86_64' run: | From 36e2b2178a979a4ca9e4e5b98b1eab152bde7555 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 19:48:35 -0400 Subject: [PATCH 4/8] wip --- .github/workflows/ci.yml | 100 +++++++++++++++++++++++--------------- martin/Cargo.toml | 2 +- multi-platform.Dockerfile | 2 +- 3 files changed, 62 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0e129add..eb7b810d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,12 +34,9 @@ jobs: - target: aarch64-apple-darwin os: macOS-latest cross: 'true' - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - cross: 'true' - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - cross: 'true' +# - target: aarch64-unknown-linux-gnu +# os: ubuntu-latest +# cross: 'true' - target: debian-x86_64 os: ubuntu-latest cross: 'true' @@ -75,37 +72,25 @@ jobs: - name: Build (native) if: matrix.cross != 'true' run: | - cargo build --release --target ${{ matrix.target }} --package martin --features=ssl --package martin cargo build --release --target ${{ matrix.target }} --package martin-mbtiles + cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl - name: Build (cross - aarch64-apple-darwin) if: matrix.target == 'aarch64-apple-darwin' run: | rustup target add "${{ matrix.target }}" # compile without debug symbols because stripping them with `strip` does not work cross-platform export RUSTFLAGS='-C link-arg=-s' - cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - - name: Build (cross - aarch64-unknown-linux-gnu) - if: matrix.target == 'aarch64-unknown-linux-gnu' - run: | - sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu - rustup target add "${{ matrix.target }}" - # compile without debug symbols because stripping them with `strip` does not work cross-platform - export RUSTFLAGS='-C link-arg=-s -C linker=aarch64-linux-gnu-gcc' cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl - cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - - name: Build (cross - aarch64-unknown-linux-musl) - if: matrix.target == 'aarch64-unknown-linux-musl' - run: | - - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS='-C link-arg=-s' cross build --target aarch64-unknown-linux-musl --package martin-mbtiles - - # sudo apt-get install -y gcc-aarch64-linux-musl binutils-aarch64-linux-musl - rustup target add "${{ matrix.target }}" - # compile without debug symbols because stripping them with `strip` does not work cross-platform - export RUSTFLAGS='-C link-arg=-s -C linker=aarch64-linux-musl-gcc' - cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl - cargo build --release --target ${{ matrix.target }} --package martin-mbtiles +# - name: Build (cross - aarch64-unknown-linux-gnu) +# if: matrix.target == 'aarch64-unknown-linux-gnu' +# run: | +# sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu +# rustup target add "${{ matrix.target }}" +# # compile without debug symbols because stripping them with `strip` does not work cross-platform +# export RUSTFLAGS='-C link-arg=-s -C linker=aarch64-linux-gnu-gcc' +# cargo build --release --target ${{ matrix.target }} --package martin-mbtiles +# cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl - name: Build (debian package) if: matrix.target == 'debian-x86_64' run: | @@ -127,6 +112,40 @@ jobs: name: build-${{ matrix.target }} path: target_releases/* + build-cross: + name: Cross-platform builds + runs-on: ubuntu-latest + env: + TARGETS: "aarch64-unknown-linux-musl x86_64-unknown-linux-musl aarch64-unknown-linux-gnu" + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: Install cross + run: | + cargo install cross + # Install latest cross version from git (disabled as it is probably less stable) + # cargo install cross --git https://github.com/cross-rs/cross + cross --version + - name: Build targets + run: | + for target in $TARGETS; do + echo -e "\n----------------------------------------------" + echo "Building $target" + mkdir -p target_releases/$target + export "CARGO_TARGET_$(echo $target | tr 'a-z-' 'A-Z_')_RUSTFLAGS"='-C link-arg=-s' + cross build --release --target $target --package martin-mbtiles + mv target/$target/release/mbtiles target_releases/$target + cross build --release --target $target --package martin --features=vendored-openssl + mv target/$target/release/martin target_releases/$target + done + - name: Save build artifacts to build-${{ matrix.target }} + uses: actions/upload-artifact@v3 + with: + name: build-cross + path: target_releases/* + test: name: Test ${{ matrix.target }} runs-on: ${{ matrix.os }} @@ -328,7 +347,7 @@ jobs: docker: name: Build docker images runs-on: ubuntu-latest - needs: [ build ] + needs: [ build, build-cross ] env: # PG_* variables are used by psql PGDATABASE: test @@ -377,19 +396,20 @@ jobs: install: true platforms: linux/amd64,linux/arm64 - - run: rm -rf target_releases - - name: Download build artifact build-aarch64-unknown-linux-gnu + - run: rm -rf target_releases2 + - name: Download build-cross artifacts uses: actions/download-artifact@v3 with: - name: build-aarch64-unknown-linux-gnu - path: target_releases/linux/arm64 - - name: Download build artifact build-x86_64-unknown-linux-gnu - uses: actions/download-artifact@v3 - with: - name: build-x86_64-unknown-linux-gnu - path: target_releases/linux/amd64 - - name: Reset permissions - run: chmod -R +x target_releases/ + name: build-cross + path: target_releases2 + - name: Reorganize build artifacts + run: | + chmod -R +x target_releases2/ + mkdir -p target_releases/linux/arm64 + mv target_releases2/aarch64-unknown-linux-musl/* target_releases/linux/arm64/ + mkdir -p target_releases/linux/amd64 + mv target_releases2/x86_64-unknown-linux-musl/* target_releases/linux/amd64/ + rm -rf target_releases2 - name: Build linux/arm64 Docker image id: docker_aarch64-unknown-linux-gnu diff --git a/martin/Cargo.toml b/martin/Cargo.toml index cdad449dc..6eb70d11e 100644 --- a/martin/Cargo.toml +++ b/martin/Cargo.toml @@ -70,7 +70,7 @@ futures.workspace = true itertools.workspace = true json-patch.workspace = true log.workspace = true -martin-mbtiles = { workspace = true, default-features = false } +martin-mbtiles.workspace = true martin-tile-utils.workspace = true num_cpus.workspace = true pmtiles.workspace = true diff --git a/multi-platform.Dockerfile b/multi-platform.Dockerfile index e1fe2f4ee..b7420a3da 100644 --- a/multi-platform.Dockerfile +++ b/multi-platform.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM alpine ARG TARGETPLATFORM LABEL org.opencontainers.image.description="Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support" From bda85cfaf0f2400a87633955d4ab18a5c218e284 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 20:16:50 -0400 Subject: [PATCH 5/8] wip --- .github/workflows/ci.yml | 48 ++++++++++------------------------------ 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb7b810d8..0a469a6ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,9 +34,6 @@ jobs: - target: aarch64-apple-darwin os: macOS-latest cross: 'true' -# - target: aarch64-unknown-linux-gnu -# os: ubuntu-latest -# cross: 'true' - target: debian-x86_64 os: ubuntu-latest cross: 'true' @@ -69,42 +66,21 @@ jobs: run: | echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append vcpkg install openssl:x64-windows-static-md - - name: Build (native) - if: matrix.cross != 'true' - run: | - cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl - - name: Build (cross - aarch64-apple-darwin) - if: matrix.target == 'aarch64-apple-darwin' - run: | - rustup target add "${{ matrix.target }}" - # compile without debug symbols because stripping them with `strip` does not work cross-platform - export RUSTFLAGS='-C link-arg=-s' - cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl -# - name: Build (cross - aarch64-unknown-linux-gnu) -# if: matrix.target == 'aarch64-unknown-linux-gnu' -# run: | -# sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu -# rustup target add "${{ matrix.target }}" -# # compile without debug symbols because stripping them with `strip` does not work cross-platform -# export RUSTFLAGS='-C link-arg=-s -C linker=aarch64-linux-gnu-gcc' -# cargo build --release --target ${{ matrix.target }} --package martin-mbtiles -# cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl - - name: Build (debian package) - if: matrix.target == 'debian-x86_64' - run: | - sudo apt-get install -y dpkg dpkg-dev liblzma-dev - cargo install cargo-deb - cargo deb -v -p martin --output target/debian/debian-x86_64.deb - - name: Move build artifacts + - name: Build run: | mkdir -p target_releases if [[ "${{ matrix.target }}" == "debian-x86_64" ]]; then + sudo apt-get install -y dpkg dpkg-dev liblzma-dev + cargo install cargo-deb + cargo deb -v -p martin --output target/debian/debian-x86_64.deb mv target/debian/debian-x86_64.deb target_releases else - mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases + rustup target add "${{ matrix.target }}" + export RUSTFLAGS='-C strip=debuginfo' + cargo build --release --target ${{ matrix.target }} --package martin-mbtiles mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases + cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl + mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases fi - name: Save build artifacts to build-${{ matrix.target }} uses: actions/upload-artifact@v3 @@ -116,8 +92,8 @@ jobs: name: Cross-platform builds runs-on: ubuntu-latest env: - TARGETS: "aarch64-unknown-linux-musl x86_64-unknown-linux-musl aarch64-unknown-linux-gnu" - + TARGETS: "aarch64-unknown-linux-musl x86_64-unknown-linux-musl" + # TODO: aarch64-unknown-linux-gnu steps: - name: Checkout sources uses: actions/checkout@v4 @@ -134,7 +110,7 @@ jobs: echo -e "\n----------------------------------------------" echo "Building $target" mkdir -p target_releases/$target - export "CARGO_TARGET_$(echo $target | tr 'a-z-' 'A-Z_')_RUSTFLAGS"='-C link-arg=-s' + export "CARGO_TARGET_$(echo $target | tr 'a-z-' 'A-Z_')_RUSTFLAGS"='-C strip=debuginfo' cross build --release --target $target --package martin-mbtiles mv target/$target/release/mbtiles target_releases/$target cross build --release --target $target --package martin --features=vendored-openssl From ec87cc3a06ce83bcdcb3947016fb360896285ba5 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 20:49:22 -0400 Subject: [PATCH 6/8] wip --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a469a6ac..a988c58b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,12 @@ jobs: cargo install cargo-deb cargo deb -v -p martin --output target/debian/debian-x86_64.deb mv target/debian/debian-x86_64.deb target_releases + elif [[ "${{ runner.os }}" == "windows" ]]; then + export RUSTFLAGS='-C strip=debuginfo' + cargo build --release --target ${{ matrix.target }} --package martin-mbtiles + mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases + cargo build --release --target ${{ matrix.target }} --package martin --features=ssl + mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases else rustup target add "${{ matrix.target }}" export RUSTFLAGS='-C strip=debuginfo' From 983b06e717034ed21e4caa6ec4ee1ebdd8fdf61e Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 21:22:58 -0400 Subject: [PATCH 7/8] wip --- .github/workflows/ci.yml | 84 +++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a988c58b8..97900ac22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,7 @@ jobs: uses: actions/checkout@v4 - name: Rust Versions run: rustc --version && cargo --version + - uses: Swatinem/rust-cache@v2 - name: Lint (Linux) if: matrix.target == 'x86_64-unknown-linux-gnu' run: | @@ -60,34 +61,35 @@ jobs: cargo clippy --package martin -- -D warnings cargo clippy --package martin --features vendored-openssl -- -D warnings cargo clippy --package martin --features bless-tests -- -D warnings + mkdir -p target_releases - name: Install OpenSSL (Windows) if: runner.os == 'Windows' shell: powershell run: | echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append vcpkg install openssl:x64-windows-static-md + - name: Build (.deb) + if: matrix.target == 'debian-x86_64' + run: | + sudo apt-get install -y dpkg dpkg-dev liblzma-dev + cargo install cargo-deb + cargo deb -v -p martin --output target/debian/debian-x86_64.deb + mv target/debian/debian-x86_64.deb target_releases - name: Build + if: matrix.target != 'debian-x86_64' run: | - mkdir -p target_releases - if [[ "${{ matrix.target }}" == "debian-x86_64" ]]; then - sudo apt-get install -y dpkg dpkg-dev liblzma-dev - cargo install cargo-deb - cargo deb -v -p martin --output target/debian/debian-x86_64.deb - mv target/debian/debian-x86_64.deb target_releases - elif [[ "${{ runner.os }}" == "windows" ]]; then - export RUSTFLAGS='-C strip=debuginfo' - cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases - cargo build --release --target ${{ matrix.target }} --package martin --features=ssl - mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases + rustup target add "${{ matrix.target }}" + if [[ "${{ runner.os }}" == "Windows" ]]; then + FEATURES="ssl" else - rustup target add "${{ matrix.target }}" - export RUSTFLAGS='-C strip=debuginfo' - cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases - cargo build --release --target ${{ matrix.target }} --package martin --features=vendored-openssl - mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases + FEATURES="vendored-openssl" fi + set -x + export RUSTFLAGS='-C strip=debuginfo' + cargo build --release --target ${{ matrix.target }} --package martin-mbtiles + mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases + cargo build --release --target ${{ matrix.target }} --package martin --features=$FEATURES + mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases - name: Save build artifacts to build-${{ matrix.target }} uses: actions/upload-artifact@v3 with: @@ -146,6 +148,7 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 - name: Start postgres uses: nyurik/action-setup-postgis@v1 id: pg @@ -271,6 +274,7 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 - name: Setup database run: tests/fixtures/initdb.sh env: @@ -361,6 +365,7 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 - name: Setup database run: tests/fixtures/initdb.sh env: @@ -474,12 +479,13 @@ jobs: - target: aarch64-apple-darwin os: ubuntu-latest name: martin-Darwin-aarch64.tar.gz - cross: 'true' sha: 'true' - - target: aarch64-unknown-linux-gnu + - target: debian-x86_64 os: ubuntu-latest - name: martin-Linux-aarch64.tar.gz - cross: 'true' + name: martin-Debian-x86_64.deb + # - target: aarch64-unknown-linux-gnu + # os: ubuntu-latest + # name: martin-Linux-aarch64.tar.gz - target: x86_64-apple-darwin os: macOS-latest name: martin-Darwin-x86_64.tar.gz @@ -491,26 +497,30 @@ jobs: - target: x86_64-unknown-linux-gnu os: ubuntu-latest name: martin-Linux-x86_64.tar.gz - - target: debian-x86_64 + # From the cross build + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + cross: 'true' + name: martin-Linux-aarch64-musl.tar.gz + - target: x86_64-unknown-linux-musl os: ubuntu-latest - name: martin-Debian-x86_64.deb cross: 'true' + name: martin-Linux-x86_64-musl.tar.gz steps: - name: Checkout sources uses: actions/checkout@v4 - name: Download build artifact build-${{ matrix.target }} + if: matrix.cross != 'true' uses: actions/download-artifact@v3 with: name: build-${{ matrix.target }} path: target/ - - name: Strip symbols - # Symbol stripping does not work cross-platform - # For cross, symbols were already removed during build - if: matrix.cross != 'true' - run: | - cd target/ - strip martin${{ matrix.ext }} - strip mbtiles${{ matrix.ext }} + - name: Download cross-build artifact build-${{ matrix.target }} + if: matrix.cross == 'true' + uses: actions/download-artifact@v3 + with: + name: build-cross + path: target/ - name: Package run: | cd target/ @@ -519,11 +529,15 @@ jobs: elif [[ "${{ matrix.target }}" == "debian-x86_64" ]]; then mv debian-x86_64.deb ../${{ matrix.name }} else + if [[ "${{ matrix.cross }}" == "true" ]]; then + mv ${{ matrix.target }}/* . + fi tar czvf ../${{ matrix.name }} martin${{ matrix.ext }} mbtiles${{ matrix.ext }} fi - - name: Generate SHA-256 (MacOS) - if: matrix.sha == 'true' - run: shasum -a 256 ${{ matrix.name }} + # TODO: why is this needed and where should the result go? + # - name: Generate SHA-256 (MacOS) + # if: matrix.sha == 'true' + # run: shasum -a 256 ${{ matrix.name }} - name: Publish if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 From 502c7b53e3626772764833ce49ddf3212bae6e65 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 29 Sep 2023 22:27:41 -0400 Subject: [PATCH 8/8] wip --- .github/workflows/ci.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97900ac22..e11fef128 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,6 @@ jobs: cargo clippy --package martin -- -D warnings cargo clippy --package martin --features vendored-openssl -- -D warnings cargo clippy --package martin --features bless-tests -- -D warnings - mkdir -p target_releases - name: Install OpenSSL (Windows) if: runner.os == 'Windows' shell: powershell @@ -74,7 +73,8 @@ jobs: sudo apt-get install -y dpkg dpkg-dev liblzma-dev cargo install cargo-deb cargo deb -v -p martin --output target/debian/debian-x86_64.deb - mv target/debian/debian-x86_64.deb target_releases + mkdir -p target_releases + mv target/debian/debian-x86_64.deb target_releases/ - name: Build if: matrix.target != 'debian-x86_64' run: | @@ -84,12 +84,15 @@ jobs: else FEATURES="vendored-openssl" fi + set -x export RUSTFLAGS='-C strip=debuginfo' cargo build --release --target ${{ matrix.target }} --package martin-mbtiles - mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases cargo build --release --target ${{ matrix.target }} --package martin --features=$FEATURES - mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases + + mkdir -p target_releases + mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases/ + mv target/${{ matrix.target }}/release/martin${{ matrix.ext }} target_releases/ - name: Save build artifacts to build-${{ matrix.target }} uses: actions/upload-artifact@v3 with: @@ -117,11 +120,13 @@ jobs: for target in $TARGETS; do echo -e "\n----------------------------------------------" echo "Building $target" - mkdir -p target_releases/$target + export "CARGO_TARGET_$(echo $target | tr 'a-z-' 'A-Z_')_RUSTFLAGS"='-C strip=debuginfo' cross build --release --target $target --package martin-mbtiles - mv target/$target/release/mbtiles target_releases/$target cross build --release --target $target --package martin --features=vendored-openssl + + mkdir -p target_releases/$target + mv target/$target/release/mbtiles target_releases/$target mv target/$target/release/martin target_releases/$target done - name: Save build artifacts to build-${{ matrix.target }}