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