]> Untitled Git - lemmy.git/blob - scripts/release.sh
prevent ordering by comment path without post filter (#3717)
[lemmy.git] / scripts / release.sh
1 #!/bin/sh
2 set -e
3 #git checkout main
4
5 # Creating the new tag
6 new_tag="$1"
7 third_semver=$(echo $new_tag | cut -d "." -f 3)
8
9 # Goto the upper route
10 CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
11 cd $CWD/../
12
13 # The ansible and docker installs should only update for non release-candidates
14 # IE, when the third semver is a number, not '2-rc'
15 if [ ! -z "${third_semver##*[!0-9]*}" ]; then
16   pushd docker
17   sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" docker-compose.yml
18   sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" docker-compose.yml
19   sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" federation/docker-compose.yml
20   git add docker-compose.yml
21   git add federation/docker-compose.yml
22   popd
23
24   # Setting the version for Ansible
25   pushd ../lemmy-ansible
26   echo $new_tag > "VERSION"
27   git add "VERSION"
28   git commit -m"Updating VERSION"
29   git tag $new_tag
30   git push origin $new_tag
31   git push
32   popd
33 fi
34
35 # Update crate versions
36 old_tag=$(grep version Cargo.toml | head -1 | cut -d'"' -f 2)
37 sed -i "s/{ version = \"=$old_tag\", path/{ version = \"=$new_tag\", path/g" Cargo.toml
38 sed -i "s/version = \"$old_tag\"/version = \"$new_tag\"/g" Cargo.toml
39 git add Cargo.toml
40 cargo check
41 git add Cargo.lock
42
43 # Update the submodules
44 git submodule update --remote
45 git add crates/utils/translations
46
47 # The commit
48 git commit -m"Version $new_tag"
49 git tag $new_tag
50
51 # export COMPOSE_DOCKER_CLI_BUILD=1
52 # export DOCKER_BUILDKIT=1
53
54 # Push
55 git push origin $new_tag
56 git push
57
58 # Pushing to any ansible deploys
59 # cd ../../../lemmy-ansible || exit
60 # ansible-playbook -i prod playbooks/site.yml --vault-password-file vault_pass