Don't upload existing translation when syncing with Crowdin. This way, we let
the existing translations be invalidated when we change the source string (this
was not happening previously since we also upload the (older) translations when
we upload the changed source strings).
When we merge main into a deploy/* branch
(e.g. https://github.com/ente-io/ente/pull/1147), all changes get pulled in not
just the one related to that deployment, and this causes almost all of the path
based workflows to run again unnecessarily. Exclude the various "deploy/**"
branches to stop these unnecessary workflows from being triggered.
Every day is too much noise - we really only need this
- When a string gets changed in the source translation, in which case this
workflow gets triggered automatically anyway.
- Before we do a new release (this doesn't automatically happen, but the
workflow can be triggered manually if needed).
For now, reduce the frequency of the daily job to pull new translations from
Crowdin: now it'll only happen on Tuesdays and Fridays (just an arbitrary
choice).
Not integrating GitHub deployments for now since creating a deployment
(anywhere) causes "This branch has not been deployed" message to appear on
unrelated branches.
Also, the Discord /github webhook doesn't support deployment status events
anyway - Discord accepts and responds to the webhook with a 204 but it doesn't
appear in the channel. This is not a big issue, we can easily massage the
payload ourselves, but just mentioning this for posterity. Refs:
* [Corresponding issue on Discord](https://github.com/discord/discord-api-docs/issues/6203#issuecomment-1608151265)
* [A general recipe](https://gist.github.com/jagrosh/5b1761213e33fc5b54ec7f6379034a22)
---
For deleting the existing deployment I had to
```
gh api /repos/ente-io/ente/deployments --jq=".[].id"
gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "/repos/ente-io/ente/deployments/1375794893"
```
This helpful hint taken from https://github.com/orgs/community/discussions/46375. Thanks!
goreleases doesn't like it if we give it a tag with a prefix, as is our case
with "cli-...".
> ⨯ release failed after 0s error=failed to parse tag 'cli-v0.0.0-rc2' as
semver: Invalid Semantic Version
The older version seemed to be disabled (it was getting triggered on a
non-existent master branch), so I'm not sure if we want this on right now. But
let's give it a go, will remove if it this needs some cleanup first.
Move all of our code into a monorepo in preparation of open sourcing our server.
First I describe the general plan, then later I've kept an exact log of the
commands that I used. This was all done prior to this commit, but this commit
(that introduces the various top level files) seems like a good way to summarize
the entire process.
Clone auth. Auth is our base repository.
```sh
git clone https://github.com/ente-io/auth.git && cd auth
```
Move all of auth's files into `auth/`.
```sh
mkdir auth
git mv `find . -maxdepth 1 | grep -v -e '\.$' -e '\.\/.git$' -e '\.\/auth$'` auth
git commit -m 'Move into auth/'
```
Add photos-web as a new remote, and fetch its main.
```sh
git remote add photos-web https://github.com/ente-io/photos-web.git
git fetch photos-web main
```
Switch to main of web-photos.
```sh
git checkout -b photos-web-main photos-web/main
```
Move all of its files into `web` (note, the find now has an extra exclusion for
`web`, but we keep all the old ones too):
```sh
mkdir web
git mv `find . -maxdepth 1 | grep -v -e '^\.$' -e '^\.\/.git$' -e '^\.\/auth$' -e '^\.\/web$'` web
git commit -m 'Move into web/'
```
Switch back to main main, and merge the photos-web branch. The
`--allow-unrelated-histories` flag is needed (since these two branches don't
have any previous common ancestor).
```sh
git checkout main
git merge --allow-unrelated-histories photos-web-main
```
That's it. We then repeat this process for all the other repositories that we
need to bring in.
There is no magic involved here, so regular git commands will continue working.
However, all the files get renamed, so to track the git history prior to this
rename commit we'll need to pass the `--follow` flag.
git log --follow -p -- auth/migration-guides/encrypted_export.md
For some file names like README.md which exist in multiple repositories, this
doesn't seem to work so good (I don't fully understand why). For example,
`git log --follow -p -- auth/README.md lists the changes to all the READMEs,
not just the auth README.md.
```sh
git clone https://github.com/ente-io/auth.git ente
cd ente
mkdir auth
git mv `find . -maxdepth 1 | grep -v -e '\.$' -e '\.\/.git$' -e '\.\/auth$'` auth
git commit -m 'Move into auth/'
git remote add photos-web https://github.com/ente-io/photos-web.git
git fetch photos-web main
git checkout -b photos-web-main photos-web/main
mkdir web
git mv `find . -maxdepth 1 | grep -v -e '^\.$' -e '^\.\/.git$' -e '^\.\/auth$' -e '^\.\/web$'` web
git commit -m 'Move into web/'
git checkout main
git merge --allow-unrelated-histories photos-web-main
git branch -D photos-web-main
git remote remove photos-web
git remote add photos-app https://github.com/ente-io/photos-app.git
git fetch photos-app main
git checkout -b photos-app-main photos-app/main
mkdir mobile
git mv `find . -maxdepth 1 | grep -v -e '^\.$' -e '^\.\/.git$' -e '^\.\/auth$' -e '^\.\/web$' -e '^\.\/mobile$'` mobile
git commit -m 'Move into mobile/'
git checkout main
git merge --allow-unrelated-histories photos-app-main
git branch -D photos-app-main
git remote remove photos-app
git remote add photos-desktop https://github.com/ente-io/photos-desktop.git
git fetch photos-desktop main
git checkout -b photos-desktop-main photos-desktop/main
mkdir desktop
git mv `find . -maxdepth 1 | grep -v -e '^\.$' -e '^\.\/.git$' -e '^\./.gitmodules$' -e '^\.\/desktop$'` desktop
git mv .gitmodules desktop
git commit -m 'Move into desktop/'
git checkout main
git merge --allow-unrelated-histories photos-desktop-main
git branch -D photos-desktop-main
git remote remove photos-desktop
git remote add cli https://github.com/ente-io/cli.git
git fetch cli main
git checkout -b cli-main cli/main
mkdir cli
git mv `find . -maxdepth 1 | grep -v -e '^\.$' -e '^\.\/.git$' -e '^\.\/cli$'` cli
git commit -m 'Move into cli/'
git checkout main
git merge --allow-unrelated-histories cli-main
git branch -D cli-main
git remote remove cli
git remote add docs https://github.com/ente-io/docs.git
git fetch docs main
git checkout -b docs-main docs/main
mkdir docs-1
git mv `find . -maxdepth 1 | grep -v -e '^\.$' -e '^\.\/.git$' -e '^\.\/docs-1$'` docs-1
git mv docs-1 docs
git commit -m 'Move into docs/'
git checkout main
git merge --allow-unrelated-histories docs-main
git branch -D docs-main
git remote remove docs
```