|
| 1 | +# Steps to releasing a new Appwrite version |
| 2 | + |
| 3 | +There are a handful of steps required to udpate the website for a new version of Appwrite: |
| 4 | + |
| 5 | +1. Replace all references of appwrite/appwrite:x.y.z with the latest version |
| 6 | +1. Update manual installation files |
| 7 | +1. Bump appwrite repo so latest main commit is used |
| 8 | + |
| 9 | +To simplify the process, you may use the following script: |
| 10 | + |
| 11 | +```shell |
| 12 | +#!/bin/bash |
| 13 | + |
| 14 | +# exit on error |
| 15 | +set -e |
| 16 | + |
| 17 | +if [ -z "$1" ] |
| 18 | + then |
| 19 | + echo "Usage: $0 <version>" |
| 20 | + exit 1 |
| 21 | +fi |
| 22 | + |
| 23 | +VERSION=$1 |
| 24 | + |
| 25 | +git stash |
| 26 | +git checkout main |
| 27 | +git pull |
| 28 | +git checkout -b feat-$VERSION-release |
| 29 | + |
| 30 | +# Replace all references of appwrite/appwrite:x.y.z with appwrite/appwrite:$VERSION |
| 31 | +PATHS=( |
| 32 | + 'src/routes/docs/advanced/self-hosting' |
| 33 | + 'src/routes/blog/post' |
| 34 | +) |
| 35 | +for p in "${PATHS[@]}"; do |
| 36 | + grep -rl "appwrite/appwrite:[0-9]*\.[0-9]*\.[0-9]*" "$p" | xargs sed -i.bak "s#appwrite/appwrite:.*#appwrite/appwrite:$VERSION#g" |
| 37 | + git add "$p/**/*.markdoc" |
| 38 | + git add "$p/*.markdoc" |
| 39 | +done |
| 40 | + |
| 41 | +# Update manual installation files |
| 42 | +cd static/install |
| 43 | +docker run -it --rm \ |
| 44 | + --volume /var/run/docker.sock:/var/run/docker.sock \ |
| 45 | + --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ |
| 46 | + --entrypoint="install" \ |
| 47 | + appwrite/appwrite:$VERSION --http-port=80 --https-port=443 --interactive=N --no-start=true |
| 48 | +cp appwrite/docker-compose.yml compose |
| 49 | +cp appwrite/.env env |
| 50 | +sed -i.bak "s#_APP_OPENSSL_KEY_V1=.*#_APP_OPENSSL_KEY_V1=your-secret-key#g" env |
| 51 | +sed -i.bak "s#_APP_DB_PASS=.*#_APP_DB_PASS=password#g" env |
| 52 | +sed -i.bak "s#_APP_DB_ROOT_PASS=.*#_APP_DB_ROOT_PASS=rootsecretpassword#g" env |
| 53 | +git add compose env |
| 54 | +rm -rf appwrite |
| 55 | +cd - |
| 56 | + |
| 57 | +# Bump appwrite repo so latest main commit is used |
| 58 | +pnpm update @appwrite.io/repo |
| 59 | +git add pnpm-lock.yaml |
| 60 | + |
| 61 | +git commit -m "Bump Appwrite version to $VERSION" |
| 62 | + |
| 63 | +read -p "Ready to push? (y/n) " -n 1 -r |
| 64 | +if [[ $REPLY =~ ^[Yy]$ ]]; then |
| 65 | + git push -u origin HEAD |
| 66 | +fi |
| 67 | +echo PR Link: |
| 68 | +echo "https://github.com/appwrite/website/compare/main...feat-$VERSION-release?expand=1&title=Bump%20Appwrite%20version%20to%20$VERSION&body=%23%23%20What%20does%20this%20PR%20do%3F%0A%0AUpdate%20installation%20and%20upgrade%20instructions%20to%20use%20the%20latest%20Appwrite%20version%0A%0A%23%23%20Test%20Plan%0A%0AManual%0A%0A%23%23%20Related%20PRs%20and%20Issues%0A%0ANone%0A%0A%23%23%23%20Have%20you%20read%20the%20%5BContributing%20Guidelines%20on%20issues%5D%28https%3A%2F%2Fgithub.com%2Fappwrite%2Fappwrite%2Fblob%2Fmaster%2FCONTRIBUTING.md%29%3F%0A%0AYes" |
| 69 | +echo |
| 70 | +echo PR Subject: |
| 71 | +echo "Bump Appwrite version to $VERSION" |
| 72 | +echo |
| 73 | +echo PR Body: |
| 74 | +echo "## What does this PR do? |
| 75 | +
|
| 76 | +Update installation and upgrade instructions to use the latest Appwrite version |
| 77 | +
|
| 78 | +## Test Plan |
| 79 | +
|
| 80 | +Manual |
| 81 | +
|
| 82 | +## Related PRs and Issues |
| 83 | +
|
| 84 | +None |
| 85 | +
|
| 86 | +### Have you read the [Contributing Guidelines on issues](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md)? |
| 87 | +
|
| 88 | +Yes" |
| 89 | +``` |
| 90 | + |
| 91 | +Run the script like: |
| 92 | + |
| 93 | +```shell |
| 94 | +./prep_release.sh 1.5.7 |
| 95 | +``` |
| 96 | + |
| 97 | +It will also output a link you can use to create PR with a populated description. |
0 commit comments