diff --git a/dist/build/docker.sh b/dist/build/docker.sh index 682618b..e7234bb 100755 --- a/dist/build/docker.sh +++ b/dist/build/docker.sh @@ -16,7 +16,7 @@ cd - mkdir -p ${PKGS_DIR}/ # Build x86_64_deb cd x86_64_debian9/ -docker build --tag tuifeed-${VERSION}-x86_64_debian9 . +docker build --build-arg branch=${VERSION} --tag tuifeed-${VERSION}-x86_64_debian9 . cd - mkdir -p ${PKGS_DIR}/deb/ mkdir -p ${PKGS_DIR}/x86_64-unknown-linux-gnu/ @@ -30,7 +30,7 @@ rm tuifeed cd - # Build x86_64_centos7 cd x86_64_centos7/ -docker build --tag tuifeed-${VERSION}-x86_64_centos7 . +docker build --build-arg branch=${VERSION} --tag tuifeed-${VERSION}-x86_64_centos7 . cd - mkdir -p ${PKGS_DIR}/rpm/ CONTAINER_NAME=$(docker create tuifeed-${VERSION}-x86_64_centos7 /bin/bash) diff --git a/dist/build/windows.ps1 b/dist/build/windows.ps1 index cfd083a..ae86310 100755 --- a/dist/build/windows.ps1 +++ b/dist/build/windows.ps1 @@ -14,7 +14,9 @@ cargo build --release # Make zip $zipName = "tuifeed-v$version-x86_64-pc-windows-msvc.zip" Set-Location .\target\release\ -Compress-Archive tuifeed.exe $zipName +Compress-Archive -Force tuifeed.exe $zipName # Get checksum -checksum.exe -t sha256 $zipName +#checksum.exe -t sha256 $zipName +Get-FileHash $zipName Move-Item $zipName .\..\..\dist\pkgs\windows\$zipName + diff --git a/dist/build/x86_64_centos7/Dockerfile b/dist/build/x86_64_centos7/Dockerfile index ea0c2c9..4b82efc 100644 --- a/dist/build/x86_64_centos7/Dockerfile +++ b/dist/build/x86_64_centos7/Dockerfile @@ -1,25 +1,26 @@ FROM centos:centos7 as builder +ARG branch +ENV branch=$branch WORKDIR /usr/src/ # Install dependencies RUN yum -y install \ git \ gcc \ pkgconfig \ - curl \ bash # Install rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rust.sh && \ chmod +x /tmp/rust.sh && \ /tmp/rust.sh -y # Clone repository -RUN git clone https://github.com/veeso/tuifeed.git +RUN git clone --branch $branch https://github.com/veeso/tuifeed.git # Set workdir to tuifeed WORKDIR /usr/src/tuifeed/ # Install cargo arxch -RUN source $HOME/.cargo/env && cargo install cargo-rpm cargo-strip +RUN source $HOME/.cargo/env && cargo install cargo-rpm # Build for x86_64 -RUN source $HOME/.cargo/env && cargo build --release && cargo strip +RUN source $HOME/.cargo/env && cargo build --release # Build pkgs RUN source $HOME/.cargo/env && yum -y install rpm-build && cargo rpm init && cargo rpm build CMD ["sh"] diff --git a/dist/build/x86_64_debian9/Dockerfile b/dist/build/x86_64_debian9/Dockerfile index c6e7f68..dbba751 100644 --- a/dist/build/x86_64_debian9/Dockerfile +++ b/dist/build/x86_64_debian9/Dockerfile @@ -1,5 +1,7 @@ FROM debian:stretch +ARG branch +ENV branch=$branch WORKDIR /usr/src/ # Install dependencies RUN apt update && apt install -y \ @@ -14,13 +16,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rust.sh && chmod +x /tmp/rust.sh && \ /tmp/rust.sh -y # Clone repository -RUN git clone https://github.com/veeso/tuifeed.git +RUN git clone --branch $branch https://github.com/veeso/tuifeed.git # Set workdir to tuifeed WORKDIR /usr/src/tuifeed/ # Install cargo deb -RUN . $HOME/.cargo/env && cargo install cargo-deb cargo-strip +RUN . $HOME/.cargo/env && cargo install cargo-deb # Build for x86_64 -RUN . $HOME/.cargo/env && cargo build --release && cargo strip +RUN . $HOME/.cargo/env && cargo build --release # Build pkgs RUN . $HOME/.cargo/env && cargo deb