High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
build: Add workflow for creating draft releases (#1402)
bo0tzz50c36068e746
diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.ymlnew file mode 100644index 0000000000..288ebdd512--- /dev/null+++ b/.github/workflows/prepare-release.yml@@ -0,0 +1,49 @@+name: Prepare new release++on:+ workflow_dispatch:+ inputs:+ serverBump:+ description: 'Bump server version'+ required: true+ default: 'false'+ type: choice+ options:+ - false+ - minor+ - patch+ mobileBump:+ description: 'Bump mobile build number'+ required: false+ type: boolean++jobs:+ tag_release:+ runs-on: ubuntu-latest++ steps:+ - name: Checkout+ uses: actions/checkout@v3++ - name: Bump version+ run: misc/release/pump-version.sh -s "${{ inputs.serverBump }}" -m "${{ inputs.mobileBump }}"++ - name: Commit and tag+ uses: EndBug/add-and-commit@v9+ with:+ author_name: Immich Release Bot+ author_email: [email protected]+ message: "Version ${{ env.IMMICH_VERSION }}"+ tag: ${{ env.IMMICH_VERSION }}+ push: true++ - name: Create draft release+ uses: softprops/action-gh-release@v1+ with:+ draft: true+ tag_name: ${{ env.IMMICH_VERSION }}+ generate_release_notes: true+ body_path: misc/release/notes.tmpl+ files: |+ docker/docker-compose.yml+ docker/example.envdiff --git a/docker/.env.example b/docker/example.envsimilarity index 100%rename from docker/.env.examplerename to docker/example.envdiff --git a/docs/docs/developer/setup.md b/docs/docs/developer/setup.mdindex e2ffd9bfb7..c48eb32bd6 100644--- a/docs/docs/developer/setup.md+++ b/docs/docs/developer/setup.md@@ -23,7 +23,7 @@ All the services are packaged to run as with single Docker Compose command.### Instructions1. Clone the project repo.-2. Run `cp docker/.env.example docker/.env`.+2. Run `cp docker/example.env docker/.env`.3. Edit `docker/.env` to provide values for the required variables `UPLOAD_LOCATION` and `JWT_SECRET`.4. From the root directory, run:diff --git a/docs/docs/install/docker-compose.md b/docs/docs/install/docker-compose.mdindex 0d969a7152..c7985e742a 100644--- a/docs/docs/install/docker-compose.md+++ b/docs/docs/install/docker-compose.md@@ -8,7 +8,7 @@ Docker Compose is the recommended method to run Immich in production. Below are### Step 1 - Download the required files-Download [`docker-compose.yml`][compose-file] [`.env.example`][env-file].+Download [`docker-compose.yml`][compose-file] [`example.env`][env-file].From a directory of your choice (e.g. `./immich-app`) run the following commands:@@ -17,7 +17,7 @@ wget https://raw.githubusercontent.com/immich-app/immich/main/docker/docker-comp``````bash title="Get .env file"-wget -O .env https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example+wget -O .env https://raw.githubusercontent.com/immich-app/immich/main/docker/example.env```### Step 2 - Populate the .env file with custom values@@ -131,5 +131,5 @@ Immich is currently under heavy development, which means you can expect breaking:::[compose-file]: https://raw.githubusercontent.com/immich-app/immich/main/docker/docker-compose.yml-[env-file]: https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example+[env-file]: https://raw.githubusercontent.com/immich-app/immich/main/docker/example.env[watchtower]: https://containrrr.dev/watchtower/diff --git a/docs/docs/install/portainer.md b/docs/docs/install/portainer.mdindex 623288fd8f..7a33421fa8 100644--- a/docs/docs/install/portainer.md+++ b/docs/docs/install/portainer.md@@ -28,7 +28,7 @@ Install Immich using Portainer's Stack feature.alt="Dot Env Example"/>-9. Copy the content of the `.env.example` file from the [GitHub repository](https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example) and paste into the editor.+9. Copy the content of the `example.env` file from the [GitHub repository](https://raw.githubusercontent.com/immich-app/immich/main/docker/example.env) and paste into the editor.10. Switch back to "**Simple Mode**".<imgdiff --git a/docs/docs/install/script.md b/docs/docs/install/script.mdindex 2636c300d1..cf1fef4713 100644--- a/docs/docs/install/script.md+++ b/docs/docs/install/script.md@@ -16,7 +16,7 @@ curl -o- https://raw.githubusercontent.com/immich-app/immich/main/install.sh | bThe script will perform the following actions:-1. Download [docker-compose.yml](https://github.com/immich-app/immich/blob/main/docker/docker-compose.yml), and the [.env](https://github.com/immich-app/immich/blob/main/docker/.env.example) file from the main branch of the [repository](https://github.com/immich-app/immich).+1. Download [docker-compose.yml](https://github.com/immich-app/immich/blob/main/docker/docker-compose.yml), and the [.env](https://github.com/immich-app/immich/blob/main/docker/example.env) file from the main branch of the [repository](https://github.com/immich-app/immich).2. Populate the `.env` file with necessary information based on the current directory path.3. Start the containers.diff --git a/docs/docs/install/unraid.md b/docs/docs/install/unraid.mdindex 18a40b489c..ebe739209f 100644--- a/docs/docs/install/unraid.md+++ b/docs/docs/install/unraid.md@@ -53,7 +53,7 @@ alt="Select Plugins > Compose.Manager > Add New Stack > Label it Immich"</details>5. Click "**Save Changes**", you will be promoted to edit stack UI labels, just leave this blank and click "**Ok**"6. Select the cog ⚙️ next to Immich, click "**Edit Stack**", then click "**Env File**"-7. Past the entire contents of the [Immich .env.example](https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example) file into the Unraid editor, then **before saving** edit the following:+7. Past the entire contents of the [Immich example.env](https://raw.githubusercontent.com/immich-app/immich/main/docker/example.env) file into the Unraid editor, then **before saving** edit the following:- `JWT_SECRET`: Generate a unique secret and paste the value here > Can be generated by either typing `openssl rand -base64 128` in your terminal or copying from [uuidgenerator](https://www.uuidgenerator.net/version1)- `UPLOAD_LOCATION`: Create a folder in your Images Unraid share and place the **absolute** location here > For example my _"images"_ share has a folder within it called _"immich"_. If I browse to this directory in the terminal and type `pwd` the output is `/mnt/user/images/immich`. This is the exact value I need to enter as my `UPLOAD_LOCATION`diff --git a/install.sh b/install.shindex dbe0d8db6a..4ef5fda537 100755--- a/install.sh+++ b/install.sh@@ -28,7 +28,7 @@ download_docker_compose_file() {download_dot_env_file() {echo "Downloading .env file..."- curl -L https://raw.githubusercontent.com/immich-app/immich/$release_version/docker/.env.example -o ./.env >/dev/null 2>&1+ curl -L https://raw.githubusercontent.com/immich-app/immich/$release_version/docker/example.env -o ./.env >/dev/null 2>&1}replace_env_value() {diff --git a/misc/release/notes.tmpl b/misc/release/notes.tmplnew file mode 100644index 0000000000..793f2a4a52--- /dev/null+++ b/misc/release/notes.tmpl@@ -0,0 +1,21 @@+## Highlights++{{RELEASE HIGHLIGHTS}}++As always, please consider supporting the project.++🎉 Cheer! 🎉+++## Support++<p align="center">+<img src="https://media.giphy.com/media/LStqgGESXW8XnuCv5y/giphy.gif" width="250" title="Loading ~4000 images/videos">+</p>+++If you find the project helpful and it helps you in some ways, you can support the project [one time](https://github.com/sponsors/alextran1502?frequency=one-time&sponsor=alextran1502) or [monthly](https://github.com/sponsors/alextran1502) from GitHub Sponsors++It is a great way to let me know that you want me to continue developing and working on this project for years to come.++## What's Changeddiff --git a/scripts/pump-version.sh b/misc/release/pump-version.shsimilarity index 69%rename from scripts/pump-version.shrename to misc/release/pump-version.shindex dc09ad42f1..c9fcf0f7e8 100755--- a/scripts/pump-version.sh+++ b/misc/release/pump-version.sh@@ -3,16 +3,25 @@## Pump one or both of the server/mobile versions in appropriate files#-# usage: './scripts/pump-version.sh <major|minor|patch|fase> <mobile|false'>+# usage: './scripts/pump-version.sh -s <major|minor|patch> <-m>## examples:-# ./scripts/pump-version.sh major false # 1.0.0+50 => 2.0.0+50-# ./scripts/pump-version.sh minor mobile # 1.0.0+50 => 1.1.0+51-# ./scripts/pump-version.sh false mobile # 1.0.0+50 => 1.0.0+51+# ./scripts/pump-version.sh -s major # 1.0.0+50 => 2.0.0+50+# ./scripts/pump-version.sh -s minor -m # 1.0.0+50 => 1.1.0+51+# ./scripts/pump-version.sh -m # 1.0.0+50 => 1.0.0+51#-SERVER_PUMP=$1-MOBILE_PUMP=$2+SERVER_PUMP="false"+MOBILE_PUMP="false"++while getopts 's:m:' flag; do+ case "${flag}" in+ s) SERVER_PUMP=${OPTARG} ;;+ m) MOBILE_PUMP=${OPTARG} ;;+ *) echo "Invalid args"+ exit 1 ;;+ esac+doneCURRENT_SERVER=$(cat server/package.json | jq -r '.version')MAJOR=$(echo $CURRENT_SERVER | cut -d '.' -f1)@@ -23,12 +32,12 @@ if [[ $SERVER_PUMP == "major" ]]; thenMAJOR=$((MAJOR + 1))elif [[ $SERVER_PUMP == "minor" ]]; thenMINOR=$((MINOR + 1))-elif [[ $1 == "patch" ]]; then+elif [[ $SERVER_PUMP == "patch" ]]; thenPATCH=$((PATCH + 1))elif [[ $SERVER_PUMP == "false" ]]; thenecho 'Skipping Server Pump'else- echo 'Expected <major|minor|patch|false> for the first argument'+ echo 'Expected <major|minor|patch|false> for the server argument'exit 1fi@@ -36,12 +45,12 @@ NEXT_SERVER=$MAJOR.$MINOR.$PATCHCURRENT_MOBILE=$(cat mobile/pubspec.yaml | grep "^version: .*+[0-9]\+$" | cut -d "+" -f2)NEXT_MOBILE=$CURRENT_MOBILE-if [[ $MOBILE_PUMP == "mobile" ]]; then+if [[ $MOBILE_PUMP == "true" ]]; thenset $((NEXT_MOBILE++))elif [[ $MOBILE_PUMP == "false" ]]; thenecho 'Skipping Mobile Pump'else- echo 'Expected <mobile|false> for the second argument'+ echo "Fatal: MOBILE_PUMP value $MOBILE_PUMP is invalid"exit 1fi@@ -65,3 +74,5 @@ if [ "$CURRENT_MOBILE" != "$NEXT_MOBILE" ]; thensed -i "s/\"android\.injected\.version\.code\" => $CURRENT_MOBILE,/\"android\.injected\.version\.code\" => $NEXT_MOBILE,/" mobile/android/fastlane/Fastfilesed -i "s/^version: $CURRENT_SERVER+$CURRENT_MOBILE$/version: $NEXT_SERVER+$NEXT_MOBILE/" mobile/pubspec.yamlfi++echo "IMMICH_VERSION=v$NEXT_SERVER" >> $GITHUB_ENV