Skip to content

Commit

Permalink
updated build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Aug 6, 2022
1 parent b8d76d0 commit 5de1af0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dist/build/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions dist/build/windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

9 changes: 5 additions & 4 deletions dist/build/x86_64_centos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
8 changes: 5 additions & 3 deletions dist/build/x86_64_debian9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM debian:stretch

ARG branch
ENV branch=$branch
WORKDIR /usr/src/
# Install dependencies
RUN apt update && apt install -y \
Expand All @@ -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

Expand Down

0 comments on commit 5de1af0

Please sign in to comment.