mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-22 10:51:29 +00:00
For untagged commits, include hash in version name (fixes #1563)
This commit is contained in:
parent
aa79c5131f
commit
b7d1d91309
7 changed files with 5 additions and 8 deletions
|
@ -4,5 +4,4 @@ docker
|
|||
api_tests
|
||||
ansible
|
||||
tests
|
||||
.git
|
||||
*.sh
|
||||
|
|
|
@ -1 +1 @@
|
|||
pub const VERSION: &str = "0.10.3";
|
||||
pub const VERSION: &str = "unknown version";
|
||||
|
|
|
@ -36,6 +36,7 @@ COPY --from=cacher /home/rust/.cargo /home/rust/.cargo
|
|||
COPY ./ ./
|
||||
|
||||
RUN sudo chown -R rust:rust .
|
||||
RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
|
||||
RUN cargo build
|
||||
|
||||
# reduce binary size
|
||||
|
|
|
@ -9,6 +9,7 @@ WORKDIR /app
|
|||
|
||||
# Copy the source folders
|
||||
COPY . ./
|
||||
RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
|
||||
|
||||
# Build for debug
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||
|
|
|
@ -9,6 +9,7 @@ WORKDIR /app
|
|||
COPY ./ ./
|
||||
|
||||
RUN sudo chown -R rust:rust .
|
||||
RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
|
||||
RUN cargo build --release
|
||||
|
||||
# reduce binary size
|
||||
|
|
|
@ -11,6 +11,7 @@ RUN apt-get update \
|
|||
WORKDIR /app
|
||||
|
||||
COPY ./ ./
|
||||
RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
|
|
|
@ -6,12 +6,6 @@ set -e
|
|||
new_tag="$1"
|
||||
third_semver=$(echo $new_tag | cut -d "." -f 3)
|
||||
|
||||
# Setting the version on the backend
|
||||
pushd ../../
|
||||
echo "pub const VERSION: &str = \"$new_tag\";" > "crates/utils/src/version.rs"
|
||||
git add "crates/utils/src/version.rs"
|
||||
popd
|
||||
|
||||
# The ansible and docker installs should only update for non release-candidates
|
||||
# IE, when the third semver is a number, not '2-rc'
|
||||
if [ ! -z "${third_semver##*[!0-9]*}" ]; then
|
||||
|
|
Loading…
Reference in a new issue